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

9
LINES

< > BotCompany Repo | #1030217 // renderRepetitionPercentage

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

Libraryless. Click here for Pure Java version (2690L/17K).

static <A> S renderRepetitionPercentage(Cl<A> entries) {
  if (empty(entries)) ret "no data";
  int total = l(entries), unique = countUniques(entries);
  int repeated = total-unique;
  ret "Repetition: " + formatDouble(doublePercentRatio(repeated, total), 1) + " %"
    + spaceRoundBracket(joinWithComma(
      n2(total, "total entry", "total entries"),
      n2(unique, "repeated entry", "repeated entries")));
}

Author comment

Began life as a copy of #1030215

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030217
Snippet name: renderRepetitionPercentage
Eternal ID of this version: #1030217/2
Text MD5: 8cf7f1d0cbe8dc2c30c7637f0ae00bb5
Transpilation MD5: d6dc3a4a915c203c853b688b4a0dd1df
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-11-17 11:34:50
Source code size: 421 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 121 / 180
Version history: 1 change(s)
Referenced in: [show references]