diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index 9d20c0163..e1ae6fe30 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -13655,7 +13655,7 @@ }, markNew: function(post, ipCount) { var counter, suffix; - suffix = ['st', 'nd', 'rd'][ipCount % 10] || 'th'; + suffix = (Math.floor(ipCount / 10)) % 10 === 1 ? 'th' : ['st', 'nd', 'rd'][ipCount % 10 - 1] || 'th'; counter = $.el('span', { className: 'ip-counter', textContent: "(" + ipCount + ")" diff --git a/builds/crx/script.js b/builds/crx/script.js index c87581b20..d8b45181b 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -13678,7 +13678,7 @@ }, markNew: function(post, ipCount) { var counter, suffix; - suffix = ['st', 'nd', 'rd'][ipCount % 10] || 'th'; + suffix = (Math.floor(ipCount / 10)) % 10 === 1 ? 'th' : ['st', 'nd', 'rd'][ipCount % 10 - 1] || 'th'; counter = $.el('span', { className: 'ip-counter', textContent: "(" + ipCount + ")" diff --git a/src/Monitoring/MarkNewIPs.coffee b/src/Monitoring/MarkNewIPs.coffee index 81c6ed4a9..263d7e53a 100644 --- a/src/Monitoring/MarkNewIPs.coffee +++ b/src/Monitoring/MarkNewIPs.coffee @@ -32,7 +32,10 @@ MarkNewIPs = MarkNewIPs.postIDs = postIDs markNew: (post, ipCount) -> - suffix = ['st', 'nd', 'rd'][ipCount % 10] or 'th' # fuck switches + suffix = if (ipCount // 10) % 10 is 1 + 'th' + else + ['st', 'nd', 'rd'][ipCount % 10 - 1] or 'th' # fuck switches counter = $.el 'span', className: 'ip-counter' textContent: "(#{ipCount})"