[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: How to round number values
Moritz Walther writes: >the XSL - part is >.....<xsl:value-of select="lipr"/>... > >with this I get "48064.63999" but I need "48.064,64". >How could I format the number ? There are two operations in question, but you may find that format-number does what you want with the rounding. Your instruction would change to something like <xsl:value-of select="format-number(lipr,'##.##0,00')"/> and you would have to make a couple declarations in an xsl:decimal-format element to swap the two separators. Read section 12.3 of the XSLT spec for the whole story. You'll want to set the number of #s and 0s to fit the largest allowable number, and you may need to deal with negative values as well. To round manually to two decimal places, do this <xsl:value-of select="round(100*lipr) div 100"/> .................David Marston XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|