Make an html number input always display 2 decimal places

后端 未结 8 526
伪装坚强ぢ
伪装坚强ぢ 2020-11-30 05:09

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?

8条回答
  •  猫巷女王i
    2020-11-30 05:55

    Pure html is not able to do what you want. My suggestion would be to write a simple javascript function to do the roudning for you.

提交回复
热议问题