fix priceFormat when price is 0

This commit is contained in:
wireless_purple 2024-07-18 18:04:02 +00:00
parent 3067e76c28
commit ab06a7bdf3

View file

@ -21,7 +21,7 @@ const getSignificantDigits = (price) => {
for (; i < 20; i++) { for (; i < 20; i++) {
if (Math.floor(avg * 10 ** i) >= 1000) break; if (Math.floor(avg * 10 ** i) >= 1000) break;
} }
if (i <= 1) i = 2; if (i <= 1 || avg == 0) i = 2;
return i; return i;
}; };