unitsofmeasurement / uom-systems

Units of Measurement Systems
http://www.uom.systems
Other
36 stars 17 forks source link

fixes UCUMFormat to identify Prefixes when inspecting UnitConverters #147

Closed andi-huber closed 5 years ago

andi-huber commented 5 years ago

I basically solved this with 2 steps

1) I refactored the UCUMFormat.format(Unit, Appendable) method into smaller junks, then isolated the processing of Kilogram in a separated method. 2) I've added a helper class UCUMFormatHelper to replace UnitConverters that are not detectable as prefixes by the formatter with ones that are.

Part 2 is not pretty and feels more like a workaround, but it fixes some unit tests.


This change is Reviewable

andi-huber commented 5 years ago

references #146

keilw commented 5 years ago

Thank you very much, will check it out later today. Just in time for the upcoming 2.0 release of uom-systems.