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

8
LINES

< > BotCompany Repo | #1006968 // toIntPercent

JavaX fragment (include)

static int toIntPercent(double ratio) {
  ret roundToInt(ratio*100);
}

// when used with map function
static int toIntPercent(float ratio) {
  ret toIntPercent((double) ratio);
}

Author comment

Began life as a copy of #1005131

download  show line numbers  debug dex  old transpilations   

Travelled to 22 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ekrmjmnbrukm, gwrvuhgaqvyk, ishqpsrjomds, jcllbfdqhrgy, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, nazvggbglmsf, omdjrrnzbjjv, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, snaazhdonpnp, tslmcundralx, tvejysmllsmz, vouqrxazstgt, whxojlpjdney, xrpafgyirdlv

No comments. add comment

Snippet ID: #1006968
Snippet name: toIntPercent
Eternal ID of this version: #1006968/3
Text MD5: 3a18b8f8a92b4a29b5ca660828a3ee3e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-31 23:35:48
Source code size: 186 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 495 / 2496
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1009780 - toPercent - synonym of toIntPercent
#1018522 - toIntPercent_ceil
#1023850 - toDoublePercent