Subject: Re: XSL SUM BUG?
From: "Andrew" <asd@xxxxxxxxxx>
Date: Thu, 19 Feb 2004 23:21:11 +0300
|
Thanks, this works of course but wrap every number in format-number() is too
cumbersome...
besides it seems only XSL understand IEEE this way ;-)
----- Original Message -----
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, February 19, 2004 11:05 PM
Subject: Re: XSL SUM BUG?
> At 2004-02-19 22:44 +0300, Andrew wrote:
> >I've following xml:
> ><aa>
> > <plan SUMM="700000.1"/>
> ></aa>
> >
> >execute sum(//plan/@SUMM) and you'll get 700000.09999...- what the ...?
> >but if you change 7 on 1 or 2 all works as expected- 1 preserved.
> >tested on .NET/xmlspy.
>
> IEEE arithmetic is not always so precise.
>
> If you do format-number(sum(//plan/@SUMM),'#.0') you will always get the
.1
> because the spec says to round lesser digits to the least significant
digit.
>
> I hope this helps.
>
> ..................... Ken
>
> --
> Public courses: upcoming world tour of hands-on XSL training events
> Each week: Monday-Wednesday: XSLT/XPath; Thursday-Friday: XSL-FO
> Washington, DC: 2004-03-15 San Francisco, CA: 2004-03-22
> Hong Kong: 2004-05-17 Germany: 2004-05-24 England: 2004-06-07
> World-wide on-site corporate, government & user group XML training!
>
> G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
> Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/
> Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
> Male Breast Cancer Awareness http://www.CraneSoftwrights.com/s/bc
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
>
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
- paths through DAGs, (continued)
- Saverio Perugini - Thu, 19 Feb 2004 14:42:33 -0500 (EST)
- Andrew - Thu, 19 Feb 2004 14:43:03 -0500 (EST)
- Andrew - Thu, 19 Feb 2004 14:57:55 -0500 (EST)
- G. Ken Holman - Thu, 19 Feb 2004 15:06:25 -0500 (EST)
- Andrew - Thu, 19 Feb 2004 15:18:53 -0500 (EST) <=
- Andreas L. Delmelle - Thu, 19 Feb 2004 17:40:39 -0500 (EST)
- J.Pietschmann - Thu, 19 Feb 2004 15:20:24 -0500 (EST)
- David Carlisle - Thu, 19 Feb 2004 15:52:30 -0500 (EST)
- Dimitre Novatchev - Thu, 19 Feb 2004 16:07:50 -0500 (EST)
|
|