Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
嗨,我是使用 jsr 363 进行单位转换应用程序的新手。任何人都可以帮助我使用 jsr 363 库(uni-api)在英里和公里之间进行转换
它是这样完成的:
Quantity<Length> len = Quantities.getQuantity(10, MetricPrefix.KILO(Units.METRE)); Quantity<Length> mile = len.to(USCustomary.MILE);
您可以在https://github.com/unitsofmeasurement/uom-demos/tree/master/console/systems/common下找到使用通用系统(包括 USCustomary)的示例
干杯,维尔纳