unit conversion library
npm install smartcar-unitConvert between distance, pressure, temperature, volume and mass units easily!
$ npm install smartcar-unit
``javascript`
const unit = require('smartcar-unit');
const miles = unit(184000, 'miles');
const kilometers = miles.as('kilometers'); // 296119.296
const kilometersRounded = miles.as('kilometers', 2); // 296119.3
| Distance | aliases |
| --------- | ------------------------------------- |
| inch | in inch inches |ft
| foot | foot feet |mi
| mile | mile miles |m
| meter | meter meters metre metres |km
| kilometer | kilometer kilometers |
| Pressure | aliases |
| ---------------------- | ------------------------------------------------------------------ |
| pounds per square inch | psi psis |pa
| pascal | pascal pascals |bar
| bar | bars |mbar
| millibar | millibar mbars millibars hectopascal hectopascals |mmhg
| millimeter of mercury | torr |atmosphere
| atmospheric | atmospheres atmospheric barometric |kpa
| kilopascal | kpas kilopascal kilopascals |
| Temperature | aliases |
| ----------- | -------------------------- |
| kelvin | k kelvin kelvins |f
| fahrenheit | fahrenheit |c
| celsius | celsius centigrade |
| Mass | aliases |
| -------- | --------------------------- |
| ounce | oz ounce ounces |lb
| pound | lbs pound pounds |g
| gram | gm gram grams |kg
| kilogram | kilogram kilograms |
| Volume | aliases |
| --------------- | ---------------------------------------------------------- |
| milliliter | ml milliliter milliliters millilitre millilitres |l
| liter | liter liters litre litres |usgal
| us gallon | usgallon usgallons |gal
| imperial gallon | gallon gallons |
| Fuel Economy | aliases |
| -------------------- | ------------- |
| kilometers per liter | kmpl km/l |mpg
| us miles per gallon | |
| Latitude/Longitude | aliases |
| ---------------------- | ------------------------------------------ |
| decimal degrees | dd degree degrees |dms
| degree/minutes/seconds | degminsec, degreesminutesseconds` |
[npm-url]: https://www.npmjs.com/package/smartcar-unit
[npm-image]: https://img.shields.io/npm/v/smartcar-unit.svg?style=flat-square
[ci-url]: https://travis-ci.com/smartcar/unit
[ci-image]: https://img.shields.io/travis/com/smartcar/unit/master.svg?style=flat-square
[coverage-url]: https://codecov.io/gh/smartcar/unit
[coverage-image]: https://img.shields.io/codecov/c/github/smartcar/unit/master.svg?style=flat-square
[gk-url]: https://greenkeeper.io
[gk-image]: https://badges.greenkeeper.io/smartcar/unit.svg?style=flat-square