xdev
xdev

Reputation: 641

Primefaces- append dollar symbol and format comma of the currency value in input text

I have a form with primefaces input text(p:inputText).Many of the input text values are of the type currency in dollars.When i try to use ,it mandates the user to include $ symbol prepended to the value.Is there any way using which on blur of the field the dollar symbol is prepended and the number gets formatted with proper commas.

Upvotes: 1

Views: 4826

Answers (1)

damian
damian

Reputation: 4044

Take a look at primefaces extensions. They have one component for doing this. This would be the code:

<pe:inputNumber id="Input2" value="#{inputNumberController.input}" symbol=" $" symbolPosition="s"  
                decimalSeparator="," thousandSeparator="." />

This is the showcase

Upvotes: 1

Related Questions