ucum

UCUM UnitFormat for JSR 363

浪子不回头ぞ 提交于 2019-12-02 11:45:17
问题 I'm using JSR 363 "Units of Measurement" with the latest reference implementation: <dependency> <groupId>javax.measure</groupId> <artifactId>unit-api</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>tec.units</groupId> <artifactId>unit-ri</artifactId> <version>1.0.2</version> </dependency> I want to print out "milliliters" in UCUM format, i.e. "mL": final UnitFormat unitFormat = ServiceProvider.current().getUnitFormatService().getUnitFormat(); final Unit<?> unit = MILLI

UCUM UnitFormat for JSR 363

喜你入骨 提交于 2019-12-02 07:52:15
I'm using JSR 363 "Units of Measurement" with the latest reference implementation: <dependency> <groupId>javax.measure</groupId> <artifactId>unit-api</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>tec.units</groupId> <artifactId>unit-ri</artifactId> <version>1.0.2</version> </dependency> I want to print out "milliliters" in UCUM format, i.e. "mL": final UnitFormat unitFormat = ServiceProvider.current().getUnitFormatService().getUnitFormat(); final Unit<?> unit = MILLI(LITRE); final String unitString=unitFormat.format(unit); Unfortunately this gives me "ml", not "mL"