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

10
LINES

< > BotCompany Repo | #1006240 - nth

JavaX fragment (include)

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   

Travelled to 10 computer(s): aoiabmzegqzx, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, sawdedvomwva, tslmcundralx, tvejysmllsmz

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: 280 / 260
Version history: 1 change(s)
Referenced in: #1006654

Formerly at http://tinybrain.de/1006240 & http://1006240.tinybrain.de