z7pz / smash-numbers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Installation

npm i smash-numbers --save

Then...

import { convert, comma } from 'smash-numbers'

convert(1000) // 1K

comma(10000) // 10,000

Options

  • convert - CAPITAL | SMALL (Defaults to CAPITAL) convert(1000, 'SMALL') // 1k
  • comma - (any thing you want) (Defaults to ,) comma(10000, '.') // 10.000

About


Languages

Language:JavaScript 100.0%