I\'m making a form where the user can enter a dollar amount using an html number input tag. Is there a way to have the input box always display 2 decimal places?
An even simpler solution would be this (IF you are targeting ALL number inputs in a particular form):
//limit number input decimal places to two $(':input[type="number"]').change(function(){ this.value = parseFloat(this.value).toFixed(2); });