I am trying to format an input number to two decimals as suggested in HTML5 Number Input - Always show 2 decimal places, but it disrupts the possibility to undo the input.
Is there a way to format numbers while keeping undo?
Try the following:
<input value="1.11" id="i"
onchange="this.value=parseFloat(this.value).toFixed(2)">
<br>Change ↑ to 1.111, hit tab
and try to undo.
Type a number then remove focus, it changes to the desired format. But you are not able to ctrl-Z back.