convert_eng - Convert numbers to and from engineering notation
convert_eng [options] number number ...
Options: +help verbose help +pref format a number using SI prefixes +ez explicitly display 'e0' +unf unformat: convert a string back to a number
Format a number (or a list of numbers) using engineering notation. Formatted/converted values will be printed to STDOUT, one per line.
Note that the options use +, instead of a conventional dash, so that negative numbers can be converted. All options can be abbreviated.
+
To format a floating-point numeric value using SI prefixes, use the +pref option.
+pref
convert_eng +pref 1e-16
To convert a string formatted with an SI prefix back to a numeric value, use the +unf option.
+unf
convert_eng +unf 77M
By default, if the exponent is zero, e0 is not displayed. To explicitly display e0, use the +ez option. This option has no effect if +pref is used.
e0
+ez
convert_eng +ez 22.2
Show verbose usage information.
Convert 50000 to 50e3:
convert_eng 50000
Convert 5000 to 5k and 0.037 to -37m:
convert_eng +p 5000 -0.037
Convert 1.23k to 1234:
convert_eng +u 1.23k
Displays 7.89 as 7.89e0:
convert_eng +ez 7.89
Number::FormatEng
Gene Sullivan (gsullivan@cpan.org)
To install Number::FormatEng, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Number::FormatEng
CPAN shell
perl -MCPAN -e shell install Number::FormatEng
For more information on module installation, please visit the detailed CPAN module installation guide.