It's a common pattern when entering a currency on touch devices to start entering the numbers, starting with the hundredths and forcing two decimal places, for example:
- User types
1
, input formats it as.01
- User then types
2
, input formats it as.12
- User then types
3
, input formats it as1.23
- User then types
4
, input formats it as12.34
- User then types
5
, input formats it as123.45
...and so on. It would also be nice if it would insert commas when the number is < 999.99 (i.e. 1,000.00
).
I'm not sure what this pattern is even referred to as, so I haven't had much luck finding this functionality amongst the many already existing number formatting scripts.