Manufacturers sell in base10 (ie, 1000 bytes in a KB, 1000 KB in a MB, etc).
Computers use data in binary, which is base2. Therefore, 1024 bytes in a KiB, 1024 KiB in a MiB, etc. Usually binary type of values are represented such as kibibytes instead of kilobytes to denote a base2 value.
You can run an exponent against the difference between the two for which value you want (^3 for GiB, ^4 for TiB, etc), assuming you are calculating like units between both sides, such as gigabytes to gibibytes.
640 GB * ((1000/1024)^3) =~ 596 GiB