You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by bu...@apache.org on 2005/08/23 20:13:09 UTC
DO NOT REPLY [Bug 36328] New: -
fmt:formatNumber ignores maxFractionDigits
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36328>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=36328
Summary: fmt:formatNumber ignores maxFractionDigits
Product: Taglibs
Version: 1.1
Platform: All
URL: http://webtuitive.com/samples/locale.jsp
OS/Version: All
Status: NEW
Severity: normal
Priority: P3
Component: Standard Taglib
AssignedTo: taglibs-dev@jakarta.apache.org
ReportedBy: hassan@webtuitive.com
CC: hassan@webtuitive.com
In the absence of an explicit locale setting, fmt:formatNumber ignores the
maxFractionDigits attribute.
Test case:
--------------------------------------------------------------------
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<c:set var="someCount" value="61"/>
<c:set var="counter1">
<fmt:formatNumber type="number"
maxFractionDigits="0" value="${ someCount / 3 }"/></c:set>
${counter1}
|
<fmt:setLocale value="en_US"/>
<c:set var="counter2">
<fmt:formatNumber type="number"
maxFractionDigits="0" value="${ someCount / 3 }"/></c:set>
${counter2}
--------------------------------------------------------------------
Most browsers will show
20 | 20
but user-agents not providing a Locale via an Accept-Language header
like wget (and Amaya) retrieve
20.333333333333332 | 20
If I manually add a header to wget, e.g.
wget --header='Accept-Language: en-us,en'
then the result is '20 | 20'
demonstration environment: Sun JDK 1.5.0_03 and JSTL 1.1.2
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org