HTML5 Number Input - Always show 2 decimal places

后端 未结 15 2128
太阳男子
太阳男子 2020-11-28 05:43

Is there\'s any way to format an input[type=\'number\'] value to always show 2 decimal places?

Example: I want to see 0.00 instead of

15条回答
  •  萌比男神i
    2020-11-28 06:39

    ui-number-mask for angular, https://github.com/assisrafael/angular-input-masks

    only this:

    
    

    If you put value one by one....

    need: 120,01
    

    digit per digit

     = 0,01
     = 0,12
     = 1,20
     = 12,00
     = 120,01 final number.
    

提交回复
热议问题