2
0
mirror of https://github.com/tenrok/maska.git synced 2026-05-15 11:59:38 +03:00

feat: allow float input

This commit is contained in:
Alexander Shabunevich
2025-02-01 19:01:19 +03:00
parent 2c37c32fa5
commit 2975377813
2 changed files with 14 additions and 7 deletions
+7
View File
@@ -182,3 +182,10 @@ test('NaN check', () => {
expect(mask.masked('.')).toBe('')
expect(mask.masked(',')).toBe('')
})
test('float input', () => {
const mask = new Mask({ number: { locale: 'uk', fraction: 2 } })
expect(mask.masked(1234.56)).toBe('1 234,56')
expect(mask.unmasked(1234.56)).toBe('1234.56')
})