To put a list of distances in order the best way is first converting all the measures to a specific unit. Convert all distances to meters:
Having all the emasures in meter you get the next order from longest to shortest:
1Mm, 1km, 100m, 50mm, 1cm, 5million nm, 1mm