Sha256: f0a87b8f03811e6b5b8fd96fc15e0069abe10dac63d169e9eb5b16a66199ee8b
Contents?: true
Size: 484 Bytes
Versions: 69
Compression:
Stored size: 484 Bytes
Contents
/** * Returns "nth" of number (1 = "st", 2 = "nd", 3 = "rd", 4..10 = "th", ...) */ function nth(i) { var t = (i % 100); if (t >= 10 && t <= 20) { return 'th'; } switch(i % 10) { case 1: return 'st'; case 2: return 'nd'; case 3: return 'rd'; default: return 'th'; } } module.exports = nth;
Version data entries
69 entries across 69 versions & 2 rubygems