1.0.3 • Published 7 years ago
iotdb-uom-imperial v1.0.3
itodb-uom-imperial
Add Imperial and US Units of Measure Conversions to IOTDB Helpers.
Usage
Here's a an example of converting meters to nautical miles.
const _ = require("iotdb-helpers")
const imperial = require("iotdb-uom-imperial")
imperial.load()
const nms = _.convert.convert({
from: "iot-unit:length.si.meter",
to: "iot-unit:length.imperial.nautical-mile",
value: 1000,
});
console.log(nms);
And yards to inches
const inches = _.convert.convert({
from: "iot-unit:length.imperial.yard",
to: "iot-unit:length.imperial.inch",
value: 1
});
console.log(inches);
KM to inches
const inches = _.convert.convert({
from: "iot-unit:length.si.meter.3", // m * 10^3 = km
to: "iot-unit:length.imperial.inch",
value: 1
});
console.log(inches);
Vocabulary
You can see the imperial vocabulary here. Not all things have conversions written yet - if we're missing anything just let us know (or fork and add it yourself)
1.0.3
7 years ago