How do I force the display of a decimal in an ExtJS NumberField to a certain precision?

后端 未结 7 2385
梦谈多话
梦谈多话 2020-12-14 10:39

I have a form with a NumberField that gets values of type float from JSON. If the values happen to be whole numbers, then no decimal places are sho

7条回答
  •  独厮守ぢ
    2020-12-14 11:05

    Best bet is probably to add a listener to the blur event for it, and then use the built in Javascript .toFixed(2) function on the value of the field.

提交回复
热议问题