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}"> <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"> </p:column> </p:row> </p:columnGroup> <p:dataTable>
source share