xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David_Mars...@lotus.com
Subject Rounding (was: Strange XSLT behaviour)
Date Thu, 12 Apr 2001 21:16:50 GMT

Robert Stuart wrote:
>The argument should not be "is this rounding rule correct?", but
>"please, may we have a selection of rounding rules".

But the original question was:
<xsl:value-of select="format-number(9.5,'00')"/> gives "10" and
<xsl:value-of select="format-number(10.5,'00')"/> also gives 10.

My answer is:
If you need to control rounding, do it yourself rather than trusting
format-number. For example,
<xsl:value-of select="format-number(floor(9.5),'00')"/>
Think of format-number as being more about commas and leading zeroes
than about numeric alteration.
.................David Marston


---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org


Mime
View raw message