Suppose I have code like this:
<h:outputFormat value="The number is {0, number, #.##}">
<f:param value="#{bean.double}" />
</h:outputFormat>
From my understanding, JSF uses MessageFormat(String pattern, Locale locale) method to convert the value. So if my locale is Spanish, and bean.double is 3.72, then the result will be 3,72 even if my SubformatPattern is #.##.
Is there a way to format the number as 3.72 and keep the locale as Spanish?
FYI, I set the locale by using the f:view element with a locale attribute — for example:
<f:view locale="#{localeBean.locale}"/>
Reference: