I know there must be a generic method but I don't even know the term to search for and I don't want to re-invent the wheel, badly.
'Separate components values' and 'composite values' don't give good results.
another example: degrees+minutes+seconds from seconds of arc, or tons+pounds+ounces from ounces.
I'm working in C but it shouldn't be too hard to translate from some other language.
The inputs would be the basic value, say total inches= 9534567, and the unit divisions, like feet=12, yards=feet*3, miles=yards*1760. The output would be 150 miles, 849 yards, 0 feet and 3 inches.
Surely this can be generalized to use some other set of unit divisions. And a whole library seems like overkill, doesn't it?