prefix-si
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

prefix-si

SI, IEC, BS1852 compatible number formatter

Travis Status

Install

$ npm install prefix-si

Usage

prefix = require('prefix-si')
 
prefix(1024*1024, "B", {binary: true})
// => "1MiB"
 
prefix(1200, "g")
// => "1.2kg"
 
prefix(4700, "R", {bs1852: true})
// => "4K7"

Readme

Keywords

Package Sidebar

Install

npm i prefix-si

Weekly Downloads

9

Version

1.2.0

License

MIT

Last publish

Collaborators

  • mleko