diff options
author | Florrie <towerofnix@gmail.com> | 2019-11-19 21:34:28 -0400 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2019-11-19 21:34:28 -0400 |
commit | ae6247c519864b4ac24d40d2af2cb2a8c4c78c17 (patch) | |
tree | 5814a72086cd4ada0b5b92c34a048c22c3c2eae2 /upd8-util.js | |
parent | c2f9fc44776f1a5cb343963a00a1524e6ff3154f (diff) |
group artist page listings by album
Diffstat (limited to 'upd8-util.js')
-rw-r--r-- | upd8-util.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/upd8-util.js b/upd8-util.js index b94ffe3a..2fe2fcc8 100644 --- a/upd8-util.js +++ b/upd8-util.js @@ -57,3 +57,15 @@ module.exports.progressPromiseAll = function (msg, array) { return val; }))); }; + +module.exports.th = function (n) { + if (n % 10 === 1 && n !== 11) { + return n + 'st'; + } else if (n % 10 === 2 && n !== 12) { + return n + 'nd'; + } else if (n % 10 === 3 && n !== 13) { + return n + 'rd'; + } else { + return n + 'th'; + } +}; |