unitsofmeasurement / uom-systems

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

Name and symbol for UCUM units #127

Closed selios closed 4 years ago

selios commented 6 years ago

Hi, Is there a reason why there is only some UCUM units with a name or symbol ? How I can have a pretty print of all units for users.

Thanks for your work.

keilw commented 6 years ago

The UCUM system has a Print format for that. UCUMFormat_Print properties (also for the uom-se based module) contain all relevant "pretty print" strings according to the UCUM catalog. Is there a UCUM unit defined in the system right now, that you find was missing such a string? Some units are still to be defined and added, but we already have tickets like https://github.com/unitsofmeasurement/uom-systems/issues/59 for that.

selios commented 6 years ago

Thanks for your help. I can now get a good print for user but is there a "UCUMFormat_Name" property for the name (according to UCUM column http://unitsofmeasure.org/ucum.html#iso1000 ) ? exemple for unit code "s" that will display "second"

keilw commented 6 years ago

At the moment the name is not rendered. It probably won't be parseable at all, since the Print variant is only for "pretty printing". One possible approach could be to extend the creation of UCUMFormat by using UnitStyle at least for the Print variant.