I was trying to convert a quantity from B to MB and I got an unexpected result.
console.log(math.format(math.eval('5000000 B to MB'), 14))
Result: 4.7683715820313 MB
I was expecting to see 5MB.
I saw in the documentation, units.md, that SI prefixes such as kilo, mega, giga, etc. have the same value as their IEC counterparts kibi, mebi, gibi, etc.
According to IEC, this is incorrect. Their definitions for kibibyte and kilobyte are as follows.
The definition of the kibibyte is:
1 kibibyte = 210 bytes = 1024 bytes.
The definition of the kilobyte is:
1 kB = 1000bytes = 10^3
I was trying to convert a quantity from B to MB and I got an unexpected result.
I was expecting to see 5MB.
I saw in the documentation, units.md, that SI prefixes such as kilo, mega, giga, etc. have the same value as their IEC counterparts kibi, mebi, gibi, etc.
According to IEC, this is incorrect. Their definitions for kibibyte and kilobyte are as follows.
The definition of the kibibyte is:
1 kibibyte = 210 bytes = 1024 bytes.
The definition of the kilobyte is:
1 kB = 1000bytes = 10^3