static S nth(int i) { S s = "th"; int tens = (i % 100)/10; if (tens != 1) { if ((i % 10) == 1) s = "st"; if ((i % 10) == 2) s = "nd"; if ((i % 10) == 3) s = "rd"; } ret i + s; }
download show line numbers debug dex old transpilations
Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1006240 |
Snippet name: | nth |
Eternal ID of this version: | #1006240/2 |
Text MD5: | 266e1986fd2339d86f9696d8a933e6eb |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-01-13 22:25:02 |
Source code size: | 208 bytes / 10 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 610 / 610 |
Version history: | 1 change(s) |
Referenced in: | [show references] |