brvphoenix / luci-app-wrtbwmon

Bandwidth monitor for OpenWRT
260 stars 55 forks source link

Fix IEC (1024) formatting (double i was being added) #71

Closed Quphoria closed 1 year ago

Quphoria commented 1 year ago

The javascript String.format function, automatically detects that IEC (1024) is being used as a multiple, and adds the "i" for Kibi, Mibi, etc. So the code removed would have added an extra "i" making it KiiB, MiiB, etc.

> String.format('%1024.2mbit', 100000)
'97.66 Kibit'
> String.format('%1000.2mbit', 100000)
'100.00 Kbit'