Beautify long number
Chopnum(num[, options])
Type: Number
Type: Number
Default: 3
Chunk length
Type: String
Default:
Separate chunks with this symbol
Type: Boolean
Default: false
Remove fractional part
Chopnum(12)
// => 12
Chopnum(123456789)
// => '123 456 789'
Chopnum(-123456789)
// => '-123 456 789'
Chopnum(123456789, { step: 4 })
// => '1 2345 6789'
Chopnum(123456789, { separator: '-' })
// => '123-456-789'
- fixed bug when minus sign was perceived as part of a number