mirror of
https://github.com/tenrok/maska.git
synced 2026-06-08 17:22:27 +03:00
fix: correct check for NaN #228
This commit is contained in:
+1
-1
@@ -20,7 +20,7 @@ export const processNumber = (value: string, masked = true, opts: MaskOptions):
|
||||
const decimal = parts.find((part) => part.type === 'decimal')?.value ?? '.'
|
||||
const float = prepare(value, group, decimal)
|
||||
|
||||
if (float === '' || Number.isNaN(float)) return sign
|
||||
if (Number.isNaN(parseFloat(float))) return sign
|
||||
|
||||
// allow zero at the end
|
||||
const floatParts = float.split('.')
|
||||
|
||||
Reference in New Issue
Block a user