How do you write your own custom measurement converters
Question
How do you write your own custom converters and specify the conversion factor using javax.measure packages. (e.g. Pint to gallons)
Solution
Well, I don't know the "correct" way to do it, but the obvious way would be to follow the pattern of the NonSI
class; i.e. create your own class containing statics for each unit, with values based on the standard definitions for the non-SI units in terms of SI units.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow