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
- Host: GitHub
- URL: https://github.com/mleko/js-prefix-si
- Owner: mleko
- License: mit
- Created: 2016-04-22T07:00:03.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-10-12T20:05:45.000Z (almost 8 years ago)
- Last Synced: 2025-02-08T12:26:29.895Z (8 months ago)
- Topics: bs1852, iec, prefix, si, typescript
- Language: TypeScript
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
## prefix-si
SI, IEC, BS1852 compatible number formatter
## 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"
```