pretty-frame-rate
v1.0.1
Published
Transform a frame-rate value into an human readable string ("30000/1001" -> "29.97fps")
Downloads
1
Readme
pretty-frame-rate
Transform a frame-rate value into an human readable string.
Installation
$ npm install pretty-frame-rate
Usage
const prettyFrameRate = require('pretty-frame-rate');
prettyFrameRate(30000 / 1001);
//=> '29.97fps'
prettyFrameRate('30000/1001');
//=> '29.97fps'
prettyFrameRate(60);
//=> '60fps'
prettyFrameRate(30000 / 1001, { decimals: 0 });
//=> '30fps'
prettyFrameRate(30, { suffix: 'ips' });
//=> '30ips'
The default options are:
const DEFAULT_OPTIONS = {
decimals: 2,
suffix: 'fps'
};
Related
- pretty-ms - Convert milliseconds to a human readable string:
1337000000
→15d 11h 23m 20s
- pretty-bytes - Convert bytes to a human readable string: 1337 → 1.34 kB
License
This project is licensed under the MIT license.