1.0.2 • Published 6 years ago
homestar-uom-imperial v1.0.2
homestar-uom-imperial
Add Imperial (and US) Units of Measure Conversions to IOTDB.
Installation
Then:
$ homestar install iotdb-uom-imperial
Usage
Here's a an example of converting meters to nautical miles.
var iotdb = require('iotdb');
var _ = iotdb._;
iotdb.modules(); // this will load extensions
var 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
var inches = _.convert.convert({
from: 'iot-unit:length.imperial.yard',
to: 'iot-unit:length.imperial.inch',
value: 1
});
console.log(inches);
KM to inches
var 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)