Your analysis is spot-on, and as @hafniumzinc says you are discovering Quantity Types.
Some practical tools, beyond just comparisons -