smash-numbers

customize your numbers ._.

Usage no npm install needed!

<script type="module">
  import smashNumbers from 'https://cdn.skypack.dev/smash-numbers';
</script>

README

Installation

npm i smash-numbers --save

Then...

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

console.log(convert(1000)) // 1K
console.log(comma(1000, '.')) // 1.000
console.log(scramble('test')) // estt
console.log(mock('test')) // tEsT

Options

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