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

21
LINES

< > BotCompany Repo | #1012450 // n_fancy2 - takes singular and plural

JavaX fragment (include)

1  
static S n_fancy2(long l, S singular, S plural) {
2  
  ret formatWithThousandsSeparator(l) + " " + trim(l == 1 ? singular : plural);
3  
}
4  
5  
static S n_fancy2(Collection l, S singular, S plural) {
6  
  ret n_fancy2(l(l), singular, plural);
7  
}
8  
9  
static S n_fancy2(Map m, S singular, S plural) {
10  
  ret n_fancy2(l(m), singular, plural);
11  
}
12  
13  
static S n_fancy2(O[] a, S singular, S plural) {
14  
  ret n_fancy2(l(a), singular, plural);
15  
}
16  
17  
ifclass MultiSet
18  
  static S n_fancy2(MultiSet ms, S singular, S plural) {
19  
    ret n_fancy2(l(ms), singular, plural);
20  
  }
21  
endif

Author comment

Began life as a copy of #1011530

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1012450
Snippet name: n_fancy2 - takes singular and plural
Eternal ID of this version: #1012450/3
Text MD5: 8ff34de6ad3e92e2b6e5271d13a6fa5c
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-12-03 16:37:39
Source code size: 562 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 445 / 475
Version history: 2 change(s)
Referenced in: [show references]