get-unit
v2.0.1
Published
Naive way to check what the unit of a passed quantity is
Downloads
46
Maintainers
Readme
get-unit
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