npm i smash-numbers --save
Then...
import { convert, comma } from 'smash-numbers'
convert(1000) // 1K
comma(10000) // 10,000
- convert - CAPITAL | SMALL (Defaults to CAPITAL)
convert(1000, 'SMALL') // 1k
- comma - (any thing you want) (Defaults to ,)
comma(10000, '.') // 10.000