- or download this
y/./,/;s/\d(?=(\d\d\d)+(,|\Z))/$&./g; # 37, counting the semicolon
- or download this
y/./,/;s/\d(?=(\d{3})+(,|$))/$&./g; # 35, counting the semicolon
- or download this
sidhekin@blackbox:~$ perl -le 'for (@ARGV) { y/./,/;s/\d(?=(\d{3})+(,|
+$))/$&./g;print }' 1234567.89 234567.89 1234567 234567
1.234.567,89
...
1.234.567
234.567
sidhekin@blackbox:~$