If you try %f as the format string to printf you will get the number printed in decimal. You'll probably also see that the last few digits have been replaced by zero, it's too big for Perl to store it accurately.
$a = 12345678901234567890;
printf("%f\n", $a);
Gives: 12345678901234567000.000000 on my Windows NT system.
For handling large numbers you could try Math::BigInt or Math::BigFloat (they both came with my ActivePerl distribution). I also recommend PDL if you're doing mathematical stuff with the numbers.
For formatting the number with commas, etc. I found Number::Format on CPAN.
I've not tried any of these modules myself (apart from PDL) so they might not do what you want.
Kevin O'Rourke
|