Thread Formatierung von Zahlen
(18 answers)
Opened by Escape at 2010-03-04 16:09 Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 #!/usr/bin/perl -w use strict; use warnings; sub format { local $_ = reverse sprintf "%.*f",2,shift; # 2=Anzahl Nachkommastellen s/(\d{3})(?=\d)(?!\d*\.)/$1,/g; tr/.,/,./; return scalar reverse; } print ":".&format(300000000)."\n"; 10 print "Hallo"
20 goto 10 |