How to make a mask for integer values in Reais?

0

I need that when the user type 1 appears on screen 1.00 or if he continues typing 15 15.00 appears and so it goes. I made a mask here but it gets add zeros whenever the user types and I just want to add it once.

value.replace(/\D/g, '').replace(/^(\d{1})/, "$1.00")

How do you fix this part?

    
asked by anonymous 21.06.2018 / 15:07

0 answers