parse-exponential

1.0.1 • Public • Published

parse-exponential Build Status

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

Package Sidebar

Install

npm i parse-exponential

Weekly Downloads

31,319

Version

1.0.1

License

MIT

Last publish

Collaborators

  • bendrucker