tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bartley, Chris - NASHCCON" <Chris.Bartley.NASHC...@acs-inc.com>
Subject <fmt:formatNumber> rounding inconsistencies
Date Tue, 20 Jan 2004 22:01:47 GMT
Hi,

I'm noticing some (rather frustrating) inconsistencies with how
<fmt:formatNumber> performs rounding of decimals.  I've attached a couple
files that illustrate the problem, but, in a nutshell, these three tags:

   <fmt:formatNumber type="currency" value="0.375"/>
   <fmt:formatNumber type="currency" value="5.565"/>
   <fmt:formatNumber type="currency" value="5.5651"/>

result in:

   $0.38
   $5.56
   $5.57

The first and third are what I expect, but the second value ($5.56) is
really throwing me.  Why isn't it $5.57?  Am I doing something wrong or is
there some other sorta magic I can use to get the rounding to work properly?

I'm using Standard Taglib version 1.0.4, JDK 1.3.1_07, Weblogic 7, and Win2k
sp4.

thanks heaps!

Chris



Mime
View raw message