[xsl] Xalan Rounding

Subject: [xsl] Xalan Rounding
From: "Nik Krimm" <Nik.Krimm@xxxxxxxxxxxxxxx>
Date: Fri, 10 May 2002 13:21:10 -0500
Another rounding question [sorry]:

With the format-number function, if the the digit to be rounded off has a value of exactly .5, xalan rounds down.  Regular round() produced the expected result (rounding up); however I'd prefer to use the format-number function because this template may output various precision decimals (0 - n decimal places).  Sticking with format-number() would allow me to pass this information is as a $format variable. 

Any suggestions on how to handle this?


<xsl:template name="average-values">
<xsl:param name="format">###</xsl:param>
<xsl:value-of select="format-number(//value ,'##')" />

[xalan output]

[desired output]


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread