Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Timeline for Outputting ordinal numbers (1st, 2nd, 3rd)

Current License: CC BY-SA 3.0

8 events
when toggle format what by license comment
May 6, 2022 at 1:57 comment added DaCuteRaccoon I made it work with ARGV: for(n of arguments)print(n+([,'st','nd','rd'][~~(n/10%10)-1?n%10:0]||'th'))
Jun 17, 2020 at 9:04 history edited Community Bot
Commonmark migration
Mar 3, 2014 at 23:20 comment added Eliseo D'Annunzio No, that's fine! Just providing a few alternatives!
Mar 3, 2014 at 16:33 comment added aebabis @WallyWest For some reason, I really like that my solution works in modern browsers. Feel free to post your own answer; I think its sufficiently different.
Mar 3, 2014 at 12:04 comment added Eliseo D'Annunzio You could bring it down to 62 with: function o(n)n+([,'st','nd','rd'][~~(n/10%10)-1?n%10:0]||'th') and you can bring it down further to 54 if you are happy to use fat arrow notation: o=n=>n+([,'st','nd','rd'][~~(n/10%10)-1?n%10:0]||'th')
Feb 14, 2014 at 19:04 history edited aebabis CC BY-SA 3.0
added 69 characters in body
Feb 14, 2014 at 0:15 review First posts
Feb 14, 2014 at 0:23
Feb 13, 2014 at 23:58 history answered aebabis CC BY-SA 3.0

AltStyle によって変換されたページ (->オリジナル) /