0

I want to see all number like that : 123 456.67 : a space when I exceeded 3 integer and always two fractions number

I tested that :

<f:view contentType="text/html" locale="en" encoding="UTF-8">

and that on each inputText :

<p:column headerText="Ajust Prix">
            <h:inputText value="#{car2.ajustPrix}" >
            <f:convertNumber pattern="#0.00" maxFractionDigits="2"  />
            </h:inputText>
        </p:column>

but I don't have the space when exceeding three integer,

how can I resolve this

begiPass
  • 2,124
  • 6
  • 36
  • 57

1 Answers1

1

The pattern attribute of <f:convertNumber> uses the java formatting patterns that can be found in javadocs for DecimalFormat. With the pattern you may specify the so-called 'grouping separator', which is what you're after. Also, it's worth reading some tutorials on the subject, like Oracle's one.

All in all, you need to use the following pattern: #,##0.00. It can be used like this:

<f:convertNumber pattern="#,##0.00" />
skuntsel
  • 11,624
  • 11
  • 44
  • 67
  • I tested that with locale="bg" it works for thousand number but "." is replaced by "," : I want "123 456.78" but I have "123 456,78" – begiPass May 08 '13 at 13:54