Welcome to the Monastery | |
PerlMonks |
Re: Weird problem with Oracle, DBI, and Scientific Notationby DigitalKitty (Parson) |
on May 15, 2002 at 00:02 UTC ( [id://166608]=note: print w/replies, xml ) | Need Help?? |
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: 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 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
In Section
Seekers of Perl Wisdom
|
|