diff --git a/tools/number.ts b/tools/number.ts index 2f7e3d0..689b3e5 100644 --- a/tools/number.ts +++ b/tools/number.ts @@ -1,6 +1,8 @@ /* eslint-disable implicit-arrow-linebreak */ export function parser(value?: string) { - const normalized = (value || '0').replace(/\s/g, '').replaceAll(',', '.'); + if (!value) return 0; + + const normalized = value.replace(/\s/g, '').replaceAll(',', '.'); return Number.parseFloat(normalized); }