pretty-frame-rate

1.0.1 • Public • Published

pretty-frame-rate Build Status Coverage Status

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: 133700000015d 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.

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i pretty-frame-rate

      Weekly Downloads

      1

      Version

      1.0.1

      License

      MIT

      Unpacked Size

      5.26 kB

      Total Files

      6

      Last publish

      Collaborators

      • dimitrinicolas