in reply to Weird problem with Oracle, DBI, and Scientific Notation

Hi.

I received an answer to 'my' DevShed posting ( about this question ) and this was the response.

From DevShed.com ( Perl forum ): Exactly what behavior do you want to change? Do you mean that after you retrieve the variable from the database and print it, it is still in scientific notation but you don't want it to be? If you are just retrieving it and printing it then the value that you get from the database is never converted to "number" context, its printed in string context. Example:
my $value = "4.1142E+11"; print "$value\n"; $value *= 1; print "$value\n"; If you run this it prints: 4.1142E+11 411420000000
After multiplication by 1 (or any arithmatic operation) $value is changed from string context to integer context. One way you could explictily do this by using the int() function
my $value = "4.1142E+11"; print int($value),"\n"; # or # $value = int($value); # print "$value\n";
which now prints 411420000000 There is a limitation, though. This won't work if the number has more than 15 digits. You can force the output using printf and converting to a float but the number becomes unpredicatble in the lower digits. If your numbers are that large then you should use the Math::BigInt module.
End of Perl forum
Hope this helps.
If not, I can ask my friend Mark about it.
Thanks,
-DK