pretty-exponential

`Number.prototype.toExponential` made beautiful.

npm install pretty-exponential
9 downloads in the last week
9 downloads in the last month

pretty-exponential

Build Status Coverage Status NPM version

Number.prototype.toExponential made beautiful: -1.243e+21-1.243×10²¹

Install

Download manually or with a package manager.

npm

npm install pretty-exponential

Bower

bower install pretty-exponential

Component

component install bmcustodio/pretty-exponential

Example

Node.js
var prettyExponential = require('pretty-exponential');
Bower
<script src="bower_components/pretty-exponential/pretty-exponential.js"></script>
Component
<script src="components/bmcustodio-pretty-exponential/pretty-exponential.js"></script>
Usage
prettyExponential(0.031245); //=> '3.1245×10⁻²'
prettyExponential(0.031245, 3); //=> '3.124×10⁻²'

License

MIT © Bruno M. Custódio

npm loves you