my $num = 1000000; # or whatever integer;

$num = reverse($num);
$num =~ s/(\d{3})/$1,/g;
chop $num if $num =~ /,$/;
$num = reverse($num);

print $num; 

I have this script to make an integer with comma at every 3 digits, from right to left.
(What should this presentation way name actaully ?? ) Like 123456 will becomes 123,456.
Is there anyway can making this simpler ? Can sprintf help ?

Another question is that how can I use 16 digits long integer ? Any LongInt there ?

Rgds,
Connie


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to