Code divided one amount by another without checking that both were in the same unit. It works on the default setup, then quietly mixes units the day someone changes a setting.
Carry the unit with every amount. A ratio of mismatched units still looks like a valid number.