0.1.4 • Published 8 years ago
css-truncate-values v0.1.4
css-truncate-values
Truncate CSS numbers while retaining the original value.
truncate('0.10em');
// => '.1em'
truncate('010.050ms');
// => '10.05ms'
truncate(['11.0s', '-06em', '-0.10rem']);
// => ['11s', '-6em', '-.10rem']
It will return the smallest possible version of any number while retaining the original value... The way it should be. :smile:
Installation
$ npm install --save css-truncate-values
API
truncate(values)
Remove the inconsistencies from CSS numbers while keeping the same value.
values
(String
|Array
) A value or array of values that you want to truncate.
truncate('00.80s');
// => '.8s'
truncate(['04px', '0.010px']);
// => ['4px', '.01px']
License
MIT © Jamen Marz