Good afternoon,
I would like to place a question here. I want to convert a decimal number to the scientific notation. I made the following routine, but it truncates the decimals:
sub dec2eng { ($mydecimal)=@_; $myscience = sprintf("%e", $mydecimal); return $myscience; }
For instance: the decimal number 0.99982928833 is converted to 9.998293e-001 - the number is rounded, and so I loose 5 decimals (28833).
Is there a way to do this calculation without recurring to outside perl modules?
Kind regards, Kepler
In reply to Decimal to Scientific notation by kepler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |