Wif Cobrador
Wif Cobrador

Reputation: 33

Prevent p:inputNumber adding a decimal point and 2 zeros when not explicitly entered?

need help with primefaces input number

<p:inputNumber id="test" value="#{test}" thousandSeparator=""/>

If my input is like this:

100

The number field adds a decimal point and 2 zeros like this:

100.00

Is there a way of restricting this? The user can input decimal points but if the user didn't, there is no need to add a decimal point and the 2 zeros.

Thanks!

Upvotes: 1

Views: 15468

Answers (2)

Raj Kumar
Raj Kumar

Reputation: 357

Set padControl="false" for inputNumber component.

Upvotes: 6

user15973727
user15973727

Reputation: 11

Set decimalSeparator=""

Upvotes: 0

Related Questions