From 1b0fda6d54e9b657334ec9a03315809f92e426b1 Mon Sep 17 00:00:00 2001 From: Kieran Perkinton Date: Fri, 8 Dec 2023 14:32:56 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Added=20back=20"x"=20to=20button?= =?UTF-8?q?=20text?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/script.js b/script.js index a88aaa1..caefaea 100644 --- a/script.js +++ b/script.js @@ -195,11 +195,15 @@ function resetCounter() { // Helpers function numberStringShortener(number) { - return number.toLocaleString('en-US', { - maximumFractionDigits: 2, - notation: 'compact', - compactDisplay: 'short' - }); + if (number > 999) { + return number.toLocaleString('en-US', { + maximumFractionDigits: 2, + notation: 'compact', + compactDisplay: 'short' + }); + } else { + return `${number}x` + } } // Event Listeners