get-unit

2.0.1 • Public • Published

get-unit Build Status

Naive way to check what the unit of a given quantity is

Installation

$ npm install get-unit --save

Usage

var getUnit = require('get-unit');
 
getUnit('5 mm');
//=> 'mm'
 
getUnit('1.004 A');
//=> 'A'
 
getUnit('1,4km');
//=> 'km'
 
getUnit('.4V');
//=> 'V'
 
getUnit('4');
//=> null

License

MIT © Arthur Verschaeve

Dependencies (0)

    Dev Dependencies (1)

    Package Sidebar

    Install

    npm i get-unit

    Weekly Downloads

    9

    Version

    2.0.1

    License

    MIT

    Last publish

    Collaborators

    • arthurvr