Math::ScientificNotation::Util - Utilities related to scientific notation
This document describes version 0.003 of Math::ScientificNotation::Util (from Perl distribution Math-ScientificNotation-Util), released on 2016-06-17.
use Math::ScientificNotation::Util qw(sci2dec); say sci2dec("1.2e-6"); # => 0.0000012
None exported by default, but they are exportable.
Convert scientific notation number to decimal number.
Note that if you are sure that your number is not too large or small, you can just let Perl convert it for you:
"1.2e-4"+0 # 0.00012 1*"1.2e8" # 120000000
but:
"1.2e-5"+0 # => 1.2e-5 1*"1.2e20" # 1.2e+20
To convert to scientific notation, you can use sprintf() with the %e, %E, %g, or %G format, for example:
sprintf()
%e
%E
%g
%G
sprintf("%.2e", 1234) # => 1.23e+03
Please visit the project's homepage at https://metacpan.org/release/Math-ScientificNotation-Util.
Source repository is at https://github.com/perlancar/perl-Math-ScientificNotation-Util.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Math-ScientificNotation-Util
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
perlancar <perlancar@cpan.org>
This software is copyright (c) 2016 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Math::ScientificNotation::Util, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Math::ScientificNotation::Util
CPAN shell
perl -MCPAN -e shell install Math::ScientificNotation::Util
For more information on module installation, please visit the detailed CPAN module installation guide.