Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

10
LINES

< > BotCompany Repo | #1033616 // srtFormatTime

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (4794L/27K).

sS srtFormatTime(double seconds) {
  int wholeSec = ifloor(seconds);
  S ms = formatInt(ifloor(frac(seconds)*1000), 3);
  S sec = formatInt(wholeSec % 60, 2);
  int wholeMin = wholeSec/60;
  S min = formatInt(wholeMin % 60, 2);
  int wholeHours = wholeMin/60;
  S hours = formatInt(wholeHours, 2);
  ret hours + ":" + min + ":" + sec + "," + ms;
}

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: 119 / 188
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)