Subject: Re: [Q] Sum Function
From: Gurnandan Kaur <teclioness@xxxxxxxxxxx>
Date: Thu, 1 Nov 2001 14:52:10 +0000 (GMT)
|
Hi,
Try the following instead:
<xsl:value-of
select="format-number(sum($BatchPayments/Amount),'###.##')"/>
Guru
--- Jonathan Calvert <jonathan_calvert@xxxxxxxxx>
wrote: > Hi.
>
> I have a serious problem with the XPath Sum
> function.
> Am I using it incorrectly? Should I use an
> alternative method for my sum calculation. Thanks
> in
> advance for the help!
>
> <Amount>10.00</Amount>
> <Amount>1.00</Amount>
> <Amount>2.76</Amount>
> <Amount>1.20</Amount>
> <Amount>1.41</Amount>
>
> Total should be 16.37
>
> but,
>
> <xsl:value-of select="sum($BatchPayments/Amount)"/>
>
> calculates the value as 16.369999999999997
>
> I do not think it matters, but this is on a Sun box
> using Xalan and Xerces.
>
> --Jonathan
>
> __________________________________________________
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
> http://personals.yahoo.com
>
> XSL-List info and archive:
> http://www.mulberrytech.com/xsl/xsl-list
>
=====
Cheers!!
Gurnandan
____________________________________________________________
Nokia Game is on again.
Go to http://uk.yahoo.com/nokiagame/ and join the new
all media adventure before November 3rd.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|