Mantis - Resin
Viewing Issue Advanced Details
931 minor always 02-12-06 20:51 03-27-06 12:14
closed 3.0.17  
none 3.0.19  
0000931: {0,number,xxxx} in not formatting number for Locale
When using parameter substition with patterns in file, numbers are not being formatted correctly for the Locale returned by the Web browser.

Here is detailed description of the problem:

In a JSP file, I used the following JSTL statement:

<fmt:message key="msg.key">
<fmt:param value="${param1}" />

In my file, I had the following message defined:
msg.key=A message with a number: {0,number,currency}

In my Web browser, I replaced the english (en) and United States languages (en_US), with Spanish (es) and Spain es_ES. I then restarted my Web browser.

The number above was formatted as US currency. It should have been formatted using a spanish format.

If I do the same with the JSTL statement <fmt:formatNumber type="currency" />, the number is formatted correctly.

This problem exists for other formats too, like {0,number}.

03-27-06 12:14