Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eoinsha/sixty-sixty
Sexagesimal absolute time formatting from a decimal seconds input
https://github.com/eoinsha/sixty-sixty
Last synced: 15 days ago
JSON representation
Sexagesimal absolute time formatting from a decimal seconds input
- Host: GitHub
- URL: https://github.com/eoinsha/sixty-sixty
- Owner: eoinsha
- Created: 2016-10-19T14:37:52.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-12T01:56:49.000Z (about 2 years ago)
- Last Synced: 2024-04-14T19:03:04.252Z (9 months ago)
- Language: JavaScript
- Size: 346 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Sixty-Sixty
===Ultra-simple formatting of absolute time given a decimal seconds floating-point input.
# Format
`[hh:]mm:ss.SSS`
- `hh` - hours (if `{ showHours: true }` in optioins)
- `mm` - minutes
- `ss` - seconds
- `SSS` - milliseconds# Usage
```js
var SixtySixty = require('sixty-sixty')();
console.log(SixtySixty(0)); // --> '00:00.000'
console.log(SixtySixty(60)); // --> '01:00.000'
console.log(SixtySixty(666.6666)); // --> '11:06.667'
console.log(SixtySixty(6025.5432)); // --> '100:25.543'
```
```js
var SixtySixty = require('sixty-sixty')({ showHours: true });
console.log(SixtySixty(0)); // --> '00:00:00.000'
console.log(SixtySixty(60)); // --> '00:01:00.000'
console.log(SixtySixty(666.6666)); // --> '00:11:06.667'
console.log(SixtySixty(6025.5432)); // --> '01:40:25.543'
```