NAME

Math::ScientificNotation::Util - Utilities related to scientific notation

VERSION

This document describes version 0.003 of Math::ScientificNotation::Util (from Perl distribution Math-ScientificNotation-Util), released on 2016-06-17.

SYNOPSIS

 use Math::ScientificNotation::Util qw(sci2dec);

 say sci2dec("1.2e-6"); # => 0.0000012

DESCRIPTION

FUNCTIONS

None exported by default, but they are exportable.

sci2dec($sci) => $dec

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

FAQ

Where is dec2sci?

To convert to scientific notation, you can use sprintf() with the %e, %E, %g, or %G format, for example:

 sprintf("%.2e", 1234)   # => 1.23e+03

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/Math-ScientificNotation-Util.

SOURCE

Source repository is at https://github.com/perlancar/perl-Math-ScientificNotation-Util.

BUGS

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.

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

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.