Add null check to formatCount function for default zero return

This commit is contained in:
MayaTheShy
2026-03-21 17:30:55 -04:00
parent 2853ca98a0
commit 23d237fa20

View File

@@ -109,6 +109,7 @@ export function getItemEmoji(itemName) {
// Compact number formatting
export function formatCount(count) {
if (count == null) return '0';
if (count >= 1000000) return `${(count / 1000000).toFixed(1)}M`;
if (count >= 1000) return `${(count / 1000).toFixed(1)}K`;
return count.toString();