How to set currency format in primefacs column group?

I would like to set the currency format in the Primefaces column Primefaces without getting the row (with currency format) of the JSF Backing Bean form.

If there is no way to set the currency format on the page, I will take the string value in the currency format, as shown below.

 public String getCurrencyFormatString(Double value) { DecimalFormat formatter = new DecimalFormat("##,###.00"); return formatter.format(value); } <p:dataTable id="paymentDataTable" var="payment" value="#{PaymentActionBean.paymentList}"> <!--Other six columns--> <p:column headerText="Total"> <h:outputText value="#{payment.totalAmount}"> <f:convertNumber pattern="#{ApplicationSetting.currencyFormat}"/> </h:outputText> </p:column> <p:columnGroup type="footer"> <p:row> <p:column colspan="7" footerText="Total:" style="text-align:right"/> <p:column footerText="#{PaymentActionBean.grandTotalAmount}" style="text-align:right"> <!--How Can I put number format (##,###.00) for grand total amount? --> </p:column> </p:row> </p:columnGroup> <p:dataTable> 
+4
source share
1 answer

Do not use footerText. Instead of this:

 <p:columnGroup type="footer"> <p:row> <p:column colspan="7" footerText="Total:" style="text-align:right"/> <p:column style="text-align:right"> <f:facet name="footer"> <h:outputText value="#{PaymentActionBean.grandTotalAmount}"> <f:convertNumber pattern="##,###.00" /> </h:outputText> </f:facet> </p:column> </p:row> </p:columnGroup> 
+2
source

All Articles