There are many types of data that are sorted differently than how they are written. Many programs do sorting after a value has been
converted to a String. But alphabetical order isnât
always preferable. For example, some âsortedâ
months: December, February, November, September. Or âsortedâ file sizes: Gigabytes, Kilobytes, Megabytes, Terabytes.
Unfortunately the natural alternative isnât any better: presenting values with inappropriate units.
For example, my MP3 player holds 42949672960
bytes of music, which was the largest I could find when I got it 0.005 centuries ago.
To solve this problem we must give the sorter data thatâs fit for a sorter (ie. 42949672960 bytes) and the
human data thatâs fit for a human (like 40 GB). We
need to sort using the native data format but display
using a human-readable String...
|  |