Floating point bug in percent formatting
Formatting a percent value with format string "0%" (no decimals) doesn't work properly
Examples: numbro(0.811).format('0%') => "81.10000000000001%" numbro(1.1).format('0%') => "110.00000000000001%" numbro(1.15)format('0%) => "114.99999999999999%" numbro(5.1).format('0%') => "509.99999999999994%" numbro(9.8).format('0%') => "980.0000000000001%"
This is numbro version 2.2.0
I'm getting the same issue as well with the latest version 2.3.1.
numbro(83.5458).format('0%');
numbro(83.5458).format({output: "percent"});
// 8354.58%
Seeing this here too (2.3.2). Any updates?
Do you guys have any updates regarding this issue?
Setting mantissa to 0 works to me.
numbro(1.1).format({output: "percent", mantissa: 0});