- Fixed issue #13

- Setting values over 10e10 to 0 in frontend
This commit is contained in:
Jan 2025-09-26 17:36:07 +02:00
parent 64f36098d9
commit 83f6400d4d

View file

@ -22,6 +22,10 @@ export const parseNumberFromString = (value, decimals = 2) => {
const normalizedValue = value.replace(',', '.').replace(/[^0-9.]/g, '');
const parsed = parseFloat(normalizedValue);
if(parsed > 10e10)
return 0;
if (isNaN(parsed)) return 0;
return Math.round(parsed * Math.pow(10, decimals)) / Math.pow(10, decimals);
}