smartcar-unit

4.3.0 • Public • Published

Unit Conversion Library NPM package Build Status Coverage Greenkeeper

Convert between distance, pressure, temperature, volume and mass units easily!

Installation

$ npm install smartcar-unit

Example Usage

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

Supported Units

Distance aliases
inch in inch inches
foot ft foot feet
mile mi mile miles
meter m meter meters metre metres
kilometer km kilometer kilometers
Pressure aliases
pounds per square inch psi psis
pascal pa pascal pascals
bar bar bars
millibar mbar millibar mbars millibars hectopascal hectopascals
millimeter of mercury mmhg torr
atmospheric atmosphere atmospheres atmospheric barometric
kilopascal kpa kpas kilopascal kilopascals
Temperature aliases
kelvin k kelvin kelvins
fahrenheit f fahrenheit
celsius c celsius centigrade
Mass aliases
ounce oz ounce ounces
pound lb lbs pound pounds
gram g gm gram grams
kilogram kg kilogram kilograms
Volume aliases
milliliter ml milliliter milliliters millilitre millilitres
liter l liter liters litre litres
us gallon usgal usgallon usgallons
imperial gallon gal gallon gallons
Fuel Economy aliases
kilometers per liter kmpl km/l
us miles per gallon mpg
Latitude/Longitude aliases
decimal degrees dd degree degrees
degree/minutes/seconds dms degminsec, degreesminutesseconds

Package Sidebar

Install

npm i smartcar-unit

Weekly Downloads

224

Version

4.3.0

License

MIT

Unpacked Size

9.99 kB

Total Files

5

Last publish

Collaborators

  • smartcarops
  • gurpreetatwal
  • smartcar-ci
  • sankethkatta