- Always includes the space character (required by the SI standard).
- Automatically selects the most suitable prefix.
- Rounds to the requested significant figures (default==5).
- Prefix may be selected as either the full name ('kilo') or the symbol ('k').
- Trailing decimal zeros of the coefficient may be included or removed.
- Rounds up to the next prefix when significant figures require, e.g. '1 M', not '1000 k'.
- Also returns the numeric coefficient and the prefix separately.
- Includes the prefixes added in November 2022: ronna, quetta, ronto, and quecto.
- include the space character following the coefficient, even if there is no prefix (try value 1).
- round to the requested significant figures (try 0.999 or 999e3, with 1 or 2 sigfig).
- return a coefficient without a prefix for zero and values outside the prefix range (try values 0, 7, Inf, 1E99).
- return a coefficient without exponent notation when the significant digits are less than three (try 1e5 to 1 sigfig).
引用格式
Stephen23 (2024). Number to Scientific Prefix (https://www.mathworks.com/matlabcentral/fileexchange/33174-number-to-scientific-prefix), MATLAB Central File Exchange. 检索来源 .
MATLAB 版本兼容性
平台兼容性
Windows macOS Linux类别
标签
致谢
参考作品: num2eng, eng2num, num2eng, num2str with metric prefix, num2sci, sci2num, Customizable Natural-Order Sort, MetricPrefixStr - Print SI Prefix Formatted Numbers, Number to Words, Words to Number
启发作品: TMM reflectivity simulator for DBR microcavity polaritons, Words to Number, Round to Electronic Component Values, num2eng, Vibration Nomogram, NUM2ENG: Fast number to engineering notation (SI) conversion, Customizable Natural-Order Sort, Numeric to Ordinal-String, Number to Words, Natural-Order Row Sort, Natural-Order Filename Sort, Interactive Regular Expression Tool
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!版本 | 已发布 | 发行说明 | |
---|---|---|---|
4.1.5 | * update image. |
||
4.1.4 | * Documentation improvements.
|
||
4.1.3 | * Improve test function robustness. |
||
4.1.2 | * Correct SEE ALSO references. |
||
4.1.1 | * Update screenshot. |
||
4.1.0 | * Add 3rd and 4th output arguments.
|
||
4.0.2 | * Fix bug with fixed-prefix special-case values (0, Inf, NaN).
|
||
4.0.1 | * Fix HTML table formatting. |
||
4.0.0 | * Accept string type inputs.
|
||
3.2.1 | * Add error IDs. |
||
3.2.0 | * Add second output argument that indicates if a prefix is used or not.
|
||
3.1.3 | * More test cases.
|
||
3.1.2 | * Update documentation.
|
||
3.1.1 | * Improve documentation. |
||
3.1.0 | * Return micro character 'µ' (rather than 'u'). |
||
3.0.1 | * Improve documentation. |
||
3.0.0.0 | * Add "fixed" prefix input option.
|
||
2.1.0.0 | * Add HTML documentation.
|
||
2.0.0.0 | * Split subimssion into two: one for num->str, other for str->num.
|
||
1.13.0.0 | - Improve handling of trailing zeros.
|
||
1.12.0.0 | - Default is now lower-case E-notation. |
||
1.11.0.0 | - Add control over allowing trailing zeros in string.
|
||
1.10.0.0 | - Edit the help section a little. |
||
1.9.0.0 | - Str->Num: space character between coefficient and prefix is optional.
|
||
1.8.0.0 | Upload all four functions for converting between numeric and string, for both SI and binary. |
||
1.6.0.0 | - Fix edge case (val=1). |
||
1.5.0.0 | - Allow positive/negative input value.
|
||
1.3.0.0 | Provide useage examples. |
||
1.1.0.0 | Edit file description to be more accurate. |
||
1.0.0.0 |