https://github.com/shrpne/from-exponential
Lightweight module to convert number from exponential notation to a human readable string.
https://github.com/shrpne/from-exponential
convert exponential notation number scientific
Last synced: 3 months ago
JSON representation
Lightweight module to convert number from exponential notation to a human readable string.
- Host: GitHub
- URL: https://github.com/shrpne/from-exponential
- Owner: shrpne
- License: mit
- Created: 2018-07-30T22:25:14.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T03:58:40.000Z (almost 3 years ago)
- Last Synced: 2025-04-10T10:42:02.023Z (6 months ago)
- Topics: convert, exponential, notation, number, scientific
- Language: JavaScript
- Homepage:
- Size: 785 KB
- Stars: 37
- Watchers: 2
- Forks: 4
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# from-exponential
[](https://www.npmjs.org/package/from-exponential)
[](https://bundlephobia.com/result?p=from-exponential)
[](https://travis-ci.com/shrpne/from-exponential)
[](https://coveralls.io/github/shrpne/from-exponential?branch=master)
[](https://github.com/shrpne/from-exponential/blob/master/LICENSE)Lightweight module to convert number from exponential notation to a human readable string.
Works opposite to [Number.prototype.toExponential()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)
## Install
```
npm install from-exponential
```## Usage
```js
import fromExponential from 'from-exponential';fromExponential(1.123e-10); // => '0.0000000001123'
fromExponential('-12.123e-1'); // => '-1.2123'
fromExponential(Number.MAX_VALUE); // => '179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
```## Related
It is complemented by the following packages:
- [pretty-num](https://github.com/shrpne/pretty-num) all-in-one solution for pretty numbers: format exponential, add thousands separator, reduce decimal precision
- [thousands](https://github.com/scurker/thousands) add thousands separators## License
MIT License