unitsofmeasurement / unit-api

Units of Measurement API
http://unitsofmeasurement.github.io/unit-api/
Other
180 stars 42 forks source link

Add a variant option when obtaining a UnitFormat from FormatService. #200

Closed jfarjona closed 3 years ago

jfarjona commented 4 years ago

It would be great to be able to obtain the variants for the formatting of units. This is a case for UCUM to obtain a formatter that uses the print, case sensitive or case insensitive formatting (see https://unitsofmeasure.org/ucum.html).

The additional method could be:

UnitFormat getUnitFormat(String name, String variant)

Thanks for the good work!

Juan

keilw commented 4 years ago

Actually the 3rd optional argument constructing a Locale is also called "variant", so we might keep that term, but let's see what others think.