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

In reply to Re: Weird problem with Oracle, DBI, and Scientific Notation by DigitalKitty
in thread Weird problem with Oracle, DBI, and Scientific Notation by vroom

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.