Since the numerator and denominator represent the same physical quantity, the fraction is equivalent to 1 and can be rewritten in either order (numerator or denominator).
These fractions are called conversion factors. To make calculations, we choose the conversion factors that cancel units each other, depending on the specific need.