Display formatted decimal numbers in Primefaces 4

2019-05-14 21:13发布

This question already has an answer here:

I have a database table with a float field and I want to display it through Primefaces. I want to display the numbers formatted as (one thousand, for example): 1.000,00 I tried:

<p:column sortBy="#{item.value}" filterBy="#{item.value}">
  <f:facet name="header">
    <h:outputText value="#{epoBundle.ListUpbTitle_value}"/>
  </f:facet>
<h:outputText value="#{item.value}"/>
<f:convertNumber pattern="#0.000" locale="pt_BR"/>
</p:column>

But got: /WEB-INF/include/entity/upb/List.xhtml @80,55 Parent not an instance of ValueHolder: org.primefaces.component.column.Column@13ec99d0

Can someone help me?

Thanks in advance.

1条回答
淡お忘
2楼-- · 2019-05-14 21:36

f:convertNumber must be inside h:outputText.

<h:outputText value="#{item.value}">
    <f:convertNumber pattern="#0.000" locale="pt_BR"/>
</h:outputText>
查看更多
登录 后发表回答