RE: [xsl] Rounding a number

Subject: RE: [xsl] Rounding a number
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 15 Sep 2006 17:53:27 +0100
> Of course the problem is that I get "1.3333333333333332"  I 
> need to round that down to three decimals.  What is the best 
> approach in XSLT 1.0?

You can use format-number($x, '#0.000'), but be aware that in XSLT 1.0 the
rounding algorithm isn't specified.

Michael Kay
http://www.saxonica.com/

Current Thread