使用jsr 363库在英里和公里之间进行单位转换

unit conversion between mile and km using jsr 363 library

您好,我刚开始使用 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)的示例

干杯, 维尔纳