An open API service indexing awesome lists of open source software.

https://github.com/mleko/js-prefix-si

SI, IEC, BS1852 compatible number formatter
https://github.com/mleko/js-prefix-si

bs1852 iec prefix si typescript

Last synced: 7 months ago
JSON representation

SI, IEC, BS1852 compatible number formatter

Awesome Lists containing this project

README

          

## prefix-si

SI, IEC, BS1852 compatible number formatter

Travis Status

## Install

```bash
$ npm install prefix-si
```

## Usage

```js
prefix = require("prefix-si").prefix
// import { prefix } from "prefix-si"

prefix(1024*1024, "B", {binary: true})
// => "1MiB"

prefix(1200, "g")
// => "1.2kg"

prefix(4700, "R", {bs1852: true})
// => "4K7"
```