2
0

🚸 (number) Avoid parsing numbers starting with 0

This commit is contained in:
Baptiste Arnaud
2024-05-27 10:36:30 +02:00
parent e1f1b58c1c
commit 3e4e7531f6
4 changed files with 69 additions and 16 deletions

View File

@@ -1 +1,4 @@
export const parseNumber = (value: string) => Number(value).toString()
export const parseNumber = (value: string) => {
if (value.startsWith('0')) return value
return parseFloat(value).toString()
}