in reply to Re: Golf, anyone? :)
in thread disappearing digit with regex and tr
perl -le 'for(@ARGV){s/\./,/;s/(?<=\d)(?=(\d\d\d)+(,|\Z))/./g;print}' +1234567.89 234567.89 1234567 234567 1.234.567,89 234.567,89 1.234.567 234.567
update..
Ok.. yours is shorter... mine is probably more efficient for not invoking $& at least :)
|
|---|