NumberField format

is it possible to set a “format” for the a NumberField? like 1,30 instead of 1,3 :slightly_smiling_face:

You can use this addon: Input Mask Add-on - Vaadin Add-on Directory

Without an addon it’s quite complicated to have something nice for the user. (you can use the converter but it will be changed only on blur, that could be enough)

okay thanks. whats the mask in my case? Is “0,00” correct? Does ist handle it when i have 10,5? I think i did id wrong :smile:

new InputMask("0,00").extend(sellPrice);

I think that will help you: Add a better Java API for number and RegExp · Issue #3 · vaadin-component-factory/input-mask · GitHub

A related issue is if your value is 1.299999… Not only is NumberField hard-coded to display it as 1.3, but if you’ve bound it to a bean, it will also immediately write back 1.3!
Ie, displaying the value to the user changes it on the server-side.