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

RE: Round function in XSL 1.0

Subject: RE: Round function in XSL 1.0
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 7 Apr 2010 08:15:20 +0100
RE:  Round function in XSL 1.0
Alternatively,

format-number($amount, '#.00')

although XSLT 1.0 isn't very prescriptive about the rounding rules that
format-number should use.

Regards,

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

> -----Original Message-----
> From: Ramesh, Marimuthu [mailto:M.Ramesh@xxxxxxxxxxx] 
> Sent: 07 April 2010 08:01
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx; anil.v@xxxxxxxxxxxxxxxxxxxxx
> Subject: RE:  Round function in XSL 1.0
> 
> Hi,
> 
> Try with the below:
> 
> <xsl:variable name="amount_val" select="'8.42500'"></xsl:variable>
> <xsl:value-of select="round(100 * number($amount_val)) div 100"/>
> 
> Regards,
> Rummy
> 
> -----Original Message-----
> From: Anil Kumar Veeramalli [mailto:anil.v@xxxxxxxxxxxxxxxxxxxxx]
> Sent: Wednesday, April 07, 2010 12:19 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Round function in XSL 1.0
> 
> Hi
>  I am using  XSL 1.0 version. I am looking for Rounding 
> function similar
> 
> to SQL.
> 
>   <xsl:variable name="amount_val" select='8.42500'></xsl:variable>
> 
> I have a variable with  the value of 8.42500. Its a string. I 
> want to round this number to 8.43. How can I do this in XSL1.0.
> 
> Please suggest me on this.
> 
> Thanks,
> Anil

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.