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

21
LINES

< > BotCompany Repo | #1011530 // n_fancy - like n(), but with thousands separator

JavaX fragment (include)

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

Author comment

Began life as a copy of #1002112

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: #1011530
Snippet name: n_fancy - like n(), but with thousands separator
Eternal ID of this version: #1011530/1
Text MD5: da6a47f9b46132621e51fbabadd8e876
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-10-30 23:59:12
Source code size: 450 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 349 / 382
Referenced in: [show references]