Skip to content

Convert a duration in seconds to `m:ss`, `mm:ss`, or `h:mm:ss`.

Notifications You must be signed in to change notification settings

percuss-io/opinionated-duration-format

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opinionated-duration-format

Convert a duration in seconds to m:ss, mm:ss, or h:mm:ss.

1. Installation

https://www.npmjs.com/package/@percuss.io/opinionated-duration-format

$ npm install @percuss.io/opinionated-duration-format

2. Usage

const format = require('@percuss.io/opinionated-duration-format');

format(37) // '0:37'
format(55.5) // '0:55'
format(178) // '2:58'
format(817) // '13:37'
format(2138.167) // '35:38'
format(5859) // '1:37:39'

About

Convert a duration in seconds to `m:ss`, `mm:ss`, or `h:mm:ss`.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published