parse-exponential
v1.0.1
Published
Parse an exponential notation string into parts
Downloads
154,685
Maintainers
Readme
parse-exponential
Parse an exponential notation string into parts
Install
$ npm install --save parse-exponential
Usage
var parseExponential = require('parse-exponential')
(10).toExponential() // => '1e+1'
parseExponential('1e+1')
//=> ['1', '+1']
API
parseExponential(exponential)
-> array[coefficient, exponent]
Parses an exponential into an a array of length 2 containing the coefficient and exponent.
exponential
Required
Type: string
An exponential notation string. Should follow the format returned by Number.prototype.toExponential
.
License
MIT © Ben Drucker