'Storage Size Conversion from multiples of 1000 to multiples of 1024

I have a task which I have to complete with Java. The task is to convert given Hard drive size from multiples of 1000 to multiples of 1024. Suppose if an input is 752 MB, the output will be 717.16 MiB.

My problem is i am unable to find the math solution for this task.

Here is the data set of conversion.

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source