2
0
mirror of https://github.com/tenrok/maska.git synced 2026-05-30 15:24:06 +03:00

fix: correct checking of the number.unsigned flag

Issue #251
This commit is contained in:
Alexander Shabunevich
2024-11-28 16:08:11 +03:00
parent e3a601e131
commit 7aba7fd0c2
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ const createFormatter = (min: number, max: number, opts: MaskOptions): Intl.Numb
})
export const processNumber = (value: string, masked = true, opts: MaskOptions): string => {
const sign = opts.number?.unsigned == null && value.startsWith('-') ? '-' : ''
const sign = opts.number?.unsigned !== true && value.startsWith('-') ? '-' : ''
const fraction = opts.number?.fraction ?? 0
let formatter = createFormatter(0, fraction, opts)