Skip to main content

units - Conversion between GB and MB (and KB)


UnitConvert[Quantity[1, "GB"], "MB"]




Quantity[1000, "Megabytes"]




Which is NOT something we would normally expect. Is this a bug?


How can I use 1024MB = 1GB for the calculation?


Thanks.



Answer



You need to use 'better' units:



UnitConvert[Quantity[1, "GiB"], "MiB"]


Quantity[1024, "Mebibytes"]



See explanation and definitions in https://en.wikipedia.org/wiki/Gigabyte


Comments