Last active
August 19, 2021 12:53
-
-
Save cmd64/41b957e25c0737a0d6c00c19cc18f25e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(this).mask("#.##0,00", { | |
byPassKeys: [188, 189, 109], | |
reverse: true, | |
placeholder: "0,00", | |
translation: { | |
'#': { | |
pattern: /-|\d/, | |
recursive: true | |
} | |
}, | |
onChange: function (value, e) { | |
e.target.value = value.replace(/(?!^)-/g, '').replace(/^,/, '').replace(/^-,/, '-'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment