Skip to content

Format numbers in Twitter like formats, thousands in K, millions in M and Trillions in T.

Notifications You must be signed in to change notification settings

vahlcode/inkmbt

Repository files navigation

inkmbt

Format numbers in Twitter like formats, thousands in K, millions in M and Trillions in T.

Quick start

Installation

npm i inkmbt

Usage

  1. Use via ES6 import
import inkmbt from "inkmbt"

console.log(inkmbt(1000)) // "1k"
console.log(inkmbt(10000)) // "10k"
console.log(inkmbt(100000)) // "100k"
  1. Use via CommonJs syntax
let inkmbt = require("inkmbt")

console.log(inkmbt(1000)) // "1k"
console.log(inkmbt(10000)) // "10k"
console.log(inkmbt(100000)) // "100k"

Author

Valentine Elum

License

MIT LICENSE

About

Format numbers in Twitter like formats, thousands in K, millions in M and Trillions in T.

Topics

Resources

Stars

Watchers

Forks