xsl-list
[Top] [All Lists]

RE: [xsl] Rounding a number

2006-09-15 09:50:29
<xsl:value-of select="round(1000*(4 div 3)) div 1000"/>
-- 
Charles Knell
cknell(_at_)onebox(_dot_)com - email



-----Original Message-----
From:     Sam Carleton <scarleton(_at_)miltonstreet(_dot_)com>
Sent:     Fri, 15 Sep 2006 12:43:02 -0400
To:       xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject:  [xsl] Rounding a number

Within the XSLT, I am doing some division, such as

<xsl:value-of select="4 div 3"/>

Of course the problem is that I get "1.3333333333333332"  I need to
round that down to three decimals.  What is the best approach in XSLT
1.0?

Sam
-- 
Miltonstreet Photography
http://www.miltonstreet.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>