[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Xalan Rounding

Subject: Xalan Rounding
From: "Nik Krimm" <Nik.Krimm@xxxxxxxxxxxxxxx>
Date: Fri, 10 May 2002 13:21:10 -0500
xalan rounding
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?

[xml]
<values>
<value>106.5</value>
</values>


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

[xalan output]
106

[desired output]
107

TIA

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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.