Libraryless. Click here for Pure Java version (4794L/27K).
1 | sS srtFormatTime(double seconds) {
|
2 | int wholeSec = ifloor(seconds); |
3 | S ms = formatInt(ifloor(frac(seconds)*1000), 3); |
4 | S sec = formatInt(wholeSec % 60, 2); |
5 | int wholeMin = wholeSec/60; |
6 | S min = formatInt(wholeMin % 60, 2); |
7 | int wholeHours = wholeMin/60; |
8 | S hours = formatInt(wholeHours, 2); |
9 | ret hours + ":" + min + ":" + sec + "," + ms; |
10 | } |
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
| Snippet ID: | #1033616 |
| Snippet name: | srtFormatTime |
| Eternal ID of this version: | #1033616/1 |
| Text MD5: | af553bba81c71ca477b43cd00356908e |
| Transpilation MD5: | 5a5bacfe7c05aea3c54221a1587b7cd0 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2021-11-26 00:30:51 |
| Source code size: | 356 bytes / 10 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 311 / 426 |
| Referenced in: | [show references] |