Scino
Format numbers in scientific notation.
Installation
npm install scino --save
Use
Simply require
scino in your program:
var scino =
(You’ll need to use a module bundler like browserify to use scino in a browser.)
Scino is a function that has three parameters:
scino(num[, precision][, options])
num
<Number>
: Number to convert to scientific notationprecision
<Number>
: Optional precision to apply to the floatoptions
<Object>
: Optional formatting options
At its most basic, scino formats numbers:
var formatted = console // => '1.2345 × 10⁻³'
The numbers’ precision can be easily adjusted:
var formatted = console // => '5.193 × 10⁻⁴'
Formatting options are also available:
var formatted = console // => '<strong>-1.23456</strong> ✖︎ 10<span>³</span>'
License
MIT. See LICENSE for details.