in reply to Weird problem with Oracle, DBI, and Scientific Notation
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() functionmy $value = "4.1142E+11"; print "$value\n"; $value *= 1; print "$value\n"; If you run this it prints: 4.1142E+11 411420000000
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.my $value = "4.1142E+11"; print int($value),"\n"; # or # $value = int($value); # print "$value\n";
|
|---|