How to do input masking something like this by appending doube zero by default to the end of price using js library imask.js or with plain javascript : 3.380.321,00 $
var currencyMask = IMask(
document.getElementById('price'),
{
mask: '$num',
blocks: {
num: {
mask: Number,
thousandsSeparator: '.'
}
}
});
var currencyMask = IMask(
document.getElementById('price2'),
{
mask: 'num$',
blocks: {
num: {
mask: Number,
thousandsSeparator: '.'
}
}
});
<script src="https://unpkg.com/imask"></script>
<input type="text" id="price" value="2700300.21">
<hr>
<p>Needed masking: 3.380.321,00 $</p>
<input type="text" id="price2">