Re: XSL SUM BUG?
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
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format