Thread Eingebene Dezimalzahl mit Komma umwandeln in Gleitkommazahl mit Punkt (15 answers)
Opened by Newbie2008 at 2008-12-06 14:50

pq
 2008-12-06 21:04
#116896 #116896
User since
2003-08-04
12209 Artikel
Admin1
[Homepage]
user image
Gast+2008-12-06 18:00:31--
renee+2008-12-06 14:01:02--
Code (perl): (dl )
1
2
3
my $var  = '5,10';
$var =~ tr/,/./;
print $var;

So geht's auch ...
Code: (dl )
 $num =~ s/(\d{1,3})(?=(?:\d{3}))/$1\,/g


nein, das macht etwas anderes als verlangt wurde, und das auch noch falsch (siehe meinen letzten beitrag)
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. -- Damian Conway in "Perl Best Practices"
lesen: Wiki:Wie frage ich & perlintro Wiki:brian's Leitfaden für jedes Perl-Problem

View full thread Eingebene Dezimalzahl mit Komma umwandeln in Gleitkommazahl mit Punkt