I am new at this but it seems to me that my application could benefit from some user defined types to help in handling things where the same value can be expressed in several units.
Volume - cubic feet, cubit metres, bushels and "bags" (cubic yards)
Linear distance feet and metres (kiliometres, miles, yards)
Temperature - Celsius and Fahrenheit (Kelvin)
I do not need quantity but perhaps someone does - dozens, gross, each
Do implementations of these exist? I hate to reimplement the wheel when others who are more qualified have done it better.
The conversions between units are stable and well known so equality can be programmed to work properly although tolerance is a bit of an issue.
Is it worth the trouble or should I just settle on an internal system on units and convert at the input and output stages?
In the long term, it seems a bit attractive to be able to subtract 50 number4 bags of grain from 40,000 bushels to calculate the amount remaining rather than spreading conversions all over the code.
|