Skip to content

Commit

Permalink
πŸ› Added back "x" to button text
Browse files Browse the repository at this point in the history
  • Loading branch information
kieranperk authored Dec 8, 2023
1 parent 1c957b7 commit 1b0fda6
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1b0fda6

Please sign in to comment.