« get me outta code hell

group artist page listings by album - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/upd8-util.js
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2019-11-19 21:34:28 -0400
committerFlorrie <towerofnix@gmail.com>2019-11-19 21:34:28 -0400
commitae6247c519864b4ac24d40d2af2cb2a8c4c78c17 (patch)
tree5814a72086cd4ada0b5b92c34a048c22c3c2eae2 /upd8-util.js
parentc2f9fc44776f1a5cb343963a00a1524e6ff3154f (diff)
group artist page listings by album
Diffstat (limited to 'upd8-util.js')
-rw-r--r--upd8-util.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/upd8-util.js b/upd8-util.js
index b94ffe3..2fe2fcc 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';
+    }
+};