fluxunit
v1.4.0
Published
A simple way to convert units of measurement
Downloads
1
Maintainers
Readme
fluxunit
A simple way to convert units of measurement
Temperature:
const { temp } = require('fluxunit');
Convert Celsius to Fahrenheit:
temp.c2F(0); // 32
Convert Celsius to Kelvin:
temp.c2K(20); // 293.15
Convert Celsius to Rankine:
temp.c2R(20); // 527.67
Convert Fahrenheit to Celsius:
temp.f2C(32); // 0
Convert Fahrenheit to Kelvin:
temp.f2K(60); // 288.71
Convert Fahrenheit to Rankine:
temp.f2R(68); // 527.67
Convert Kelvin to Fahrenheit:
temp.k2F(300); // 80.33
Convert Kelvin to Celsius:
temp.k2C(300); // 26.85
Convert Kelvin to Rankine:
temp.k2R(300); // 540
Convert Rankine to Celsius:
temp.r2C(0); // -273.15
Convert Rankine to Fahrenheit:
temp.r2F(300); // -159.67
Convert Rankine to Kelvin:
temp.r2K(18); // 10
Distance:
const { dist } = require('fluxunit');
Convert Centimeters to Feet:
dist.cm2FT(91.44); // 3
Convert Centimeters to Inches:
dist.cm2IN(127); // 50
Convert Centimeters to Millimeters:
dist.cm2MM(20); // 200
Convert Feet to Centimeters:
dist.ft2CM(2); // 60.96
Convert Feet to Millimeters:
dist.ft2MM(2); // 609.6
Convert Feet to Inches:
dist.ft2IN(2); // 24
Convert Feet to Meters:
dist.ft2M(2); // 0.6096
Convert Inches to Centimeters:
dist.in2CM(20); // 50.8
Convert Inches to Feet:
dist.in2FT(24); // 2
Convert Inches to Meters:
dist.in2M(20); // 0.508
Convert Inches to Millimeters:
dist.in2MM(20); // 508
Convert Kilometers to Miles:
dist.km2MI(20); // 12.427423844746679
Convert Meters to Feet:
dist.m2FT(0.6098); // 2
Convert Meters to Inches:
dist.m2IN(0.508); // 20
Convert Miles to Kilometers:
dist.mi2KM(12.427423844746679); // 20
Convert Millimeters to Centimeters:
dist.mm2CM(200); // 20
Convert Millimeters to Feet:
dist.mm2FT(609.6); // 2
Convert Millimeters to Inches:
dist.mm2IN(609.6); // 24
Mass:
const { mass } = require('fluxunit');
Convert Grams to Kilograms:
mass.g2KG(1000); // 1
Convert Grams to Milligrams:
mass.g2MG(4); // 4000
Convert Grams to Ounces:
mass.g2O(5); // 0.17636982918934785
Convert Grams to Pounds:
mass.g2O(5); // 0.011023113109243879
Convert Kilograms to Grams:
mass.kg2G(2); // 2000
Convert Kilograms to Milligrams:
mass.kg2MG(.5); // 500000
Convert Kilograms to Pounds:
mass.kg2P(10); // 22.046226218487757
Convert Kilograms to Tons:
mass.kg2T(100); // 0.1
Convert Milligrams to Grams:
mass.mg2G(10); // 0.01
Convert Milligrams to Kilograms:
mass.mg2KG(1000); // 0.001
Convert Ounces to Grams:
mass.o2G(7); // 0.24691776086508696
Convert Ounces to Kilograms:
mass.o2KG(3); // 0.08504856
Convert Ounces to Pounds:
mass.o2P(80); // 5
Convert Pounds to Grams:
mass.p2G(.003); // 1.3607771100000001
Convert Pounds to Kilograms:
mass.p2KG(20); // 9.071847400000001
Convert Pounds to Ounces:
mass.p2O(20); // 320
Convert Pounds to Stones:
mass.p2S(1); // 14
Convert Pounds to Tons:
mass.p2T(7); // 0.00317514659
Convert Tons to Kilograms:
mass.t2KG(1); // 1000
Convert Tons to Pounds:
mass.t2P(.005); // 11.02311310924388