Basically the same problem as Format file size as MB, GB etc: Format the size of a file in a human readable way. The twist: I need it to be the same algorithm that MS windows uses in its file explorer (or else my users get confused). What algorithm does MS use?
Note: It's not the one from the answers to the referenced question