63
rated 0 times
[
65]
[
2]
/ answers: 1 / hits: 27079
/ 6 Years ago, wed, june 6, 2018, 12:00:00
I have failed to convert the input value to currency format. I want to automaticly add thousands and decimal separators when the user types the number (5,000.00; 125,000.00).
Here's my code :
$('input.CurrencyInput').on('blur, focus, keyup',
function() {
$(this).val().toLocaleString('en-US', {
style: 'decimal',
maximumFractionDigits: 2,
minimumFractionDigits: 2
});
});
More From » jquery