2.0.1 • Published 9 years ago

get-unit v2.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

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