Input with 3 decimal places without entering the decimal

What is the best way to create an input where the user enters digits and the decimal is automatically after each keystroke? For example, if the user types 1 2 3 4, the field would show:

0.001

0.012

0.123

1.234

Thanks