Perform math operations and conversions on object-oriented weights & measurements.
import {Gram} from "measurement-toolkit";
const grams = new Gram(245);
const ounces = grams.to.Ounce();
> Ounce {
> value: 8.6421206776472
> }
import {Kilogram, TroyOunce} from "measurement-toolkit";
const kgs = new Kilogram(5);
const toz = new TroyOunce(3);
kgs.subtract(toz);
> Kilogram {
> value: 4.9066895696
> }
Measure | System | Units | |
---|---|---|---|
Mass | SI | Yoctogram, Zeptogram, Attogram, Femtogram, Picogram, Nanogram, Microgram, Milligram, Centigram, Decigram, Gram, Decagram, Hectogram, Kilogram, Megagram, Gigagram, Teragram, Petagram, Exagram, Zettagram, Yottagram | |
US | Avoirdupois | Grain, Dram, Ounce, Quarter, Hundredweight, Pound, AvoirdupoisTon | |
Troy | TroyOunce, TroyPound | ||
Length | SI | Yoctometer, Zeptometer, Attometer, Femtometer, Picometer, Nanometer, Micrometer, Millimeter, Centimeter, Decimeter, Meter, Decameter, Hectometer, Kilometer, Megameter, Gigameter, Terameter, Petameter, Exameter, Zettameter, Yottameter | |
US | Yard, Inch, Foot, Mile | ||
Time | SI | Yoctosecond, Zeptosecond, Attosecond, Femtosecond, Picosecond, Nanosecond, Microsecond, Millisecond, Centisecond, Decisecond, Second, Decasecond, Hectosecond, Kilosecond, Megasecond, Gigasecond, Terasecond, Petasecond, Exasecond, Zettasecond, Yottasecond | |
Other | Minute, Hour, Day |
npm i measurement-toolkit
npm run build:docs
npm test
npm run lint
npm run test:coverage