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

8
LINES

< > BotCompany Repo | #1036395 // formatHours_roundUp

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

Libraryless. Click here for Pure Java version (128L/1K).

sS formatHours_roundUp(long ms, int decimals default 1) {
  ret formatHours_roundUp(toHours(ms), decimals);
}

sS formatHours_roundUp(double hours, int decimals default 1) {
  S formatted = formatDouble_roundUp(hours, decimals);
  ret eq(formatted, "1") ? "1 hour" : formatted + " hours";
}

Author comment

Began life as a copy of #1036176

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): elmgxqgtpvxh, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1036395
Snippet name: formatHours_roundUp
Eternal ID of this version: #1036395/1
Text MD5: 0fa202498422de44afdfd1a4ed141e6c
Transpilation MD5: f0ef3061020d0690785c50d302b04e21
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-12-06 15:42:08
Source code size: 297 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 115 / 172
Referenced in: [show references]