Open eradman opened 8 months ago
version: numbro 2.4.0
After transitioning from numeral.js I noticed that a format string of '0' does not round to the nearest integer
'0'
> var numbro = require("numbro"); undefined > num = numbro(23.4333333); R { _value: 23.4333333 } > num.format('0') '23.4333333'
Adding one or more decimal places does round to the specified number of digits
> num.format('0.0') '23.4' > num.format('0.00') '23.43'
Is there an alternate syntax for displaying a number with no decimal places?
Looks like I bumped into the same issue:
> numbro(0.99123).format('0%') '99.123%'
The expected output is '99%'
version: numbro 2.4.0
After transitioning from numeral.js I noticed that a format string of
'0'
does not round to the nearest integerAdding one or more decimal places does round to the specified number of digits
Is there an alternate syntax for displaying a number with no decimal places?