This ought to be simple, but I just can't figure it out:
How do I print a large integer with thousands separators? I.e. I want a large integer (for example 65674564376548) to be printed as 65,674,564,376,548.
I'm sure a regexp can do it. The example below works, but it starts from the left, and thus doesn't produce what I want...
$n = 65674564376548;
$n =~ s/([0-9]{3})/$1 /g;
Any tips appreciated.
~Mike
How do I print a large integer with thousands separators? I.e. I want a large integer (for example 65674564376548) to be printed as 65,674,564,376,548.
I'm sure a regexp can do it. The example below works, but it starts from the left, and thus doesn't produce what I want...
$n = 65674564376548;
$n =~ s/([0-9]{3})/$1 /g;
Any tips appreciated.
~Mike