locale attribute in convertNumber tag in XHTML not working in Tomcat

48 Views Asked by At

I am using primefaces in my application for UI and in one of the table I have a column for currency in dollar.

Below is the column tag in xhtml, the expected behavior is that whenever the value is negative then it should be displayed as ($value) in UI.

For example if the value is coming as -0.85 then it should be displayed as ($0.84) in UI. This I have achieved using the locale attribute in convertNumber tag. If the locale attribute is set to "en-US" then this conversion is achieved.

The application is deployed in Jboss and everything is working as expected.

But recently I have moved from Jboss to Tomcat and this conversion is not working now, I am getting the value as -$0.87 in UI when deployed to Tomcat which is not what I need. It should be same as how it was working in Jboss.

Please let me know how to fix this

<p:column exportable="true">
  <f:facet name="header">
    <h:outputLabel value="Difference" />
  </f:facet>
  <h:outputText value="#{CurrencyVar.Amt}"
  style="float:right;">
    <f:convertNumber type="currency" locale="en-US"
    maxFractionDigits="2" />
  </h:outputText>
</p:column>
0

There are 0 best solutions below