This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: rounding numbers up or down


Try round($Total_Pages * 2) div 2.

Cheers,
--Jonathan

----- Original Message -----
From: "Joerg Heinicke" <joerg.heinicke@gmx.de>
To: <xsl-list@lists.mulberrytech.com>
Sent: Tuesday, March 05, 2002 11:26 AM
Subject: Re: [xsl] rounding numbers up or down


> XPATH has a function round(). If you have such things with 0.5, you can
> do something similar to <xsl:value-of select="round($Total_Pages) +
> 0.5)"/>. How do you want to handle numbers between 0.5 and 0.999999?
> Maybe you need a <xsl:choose>-statement.
>
> Regards,
>
> Joerg
>
> Paul Mortimer wrote:
> > Hi,
> >
> > Right, here's the  problem ...Im paging through my data using a stored
procedure, and returning the data in xml chunks...
> > On the display page I've got a counter that displays how many pages
there are and the users current page.. The problem I've got is that I need
to round up all values of less than .5 to the nearest .5  e.g. 0.1 rounded
to  0.5.
> >
> > The only syntax I can find is something like ..
> >
> > <xsl:value-of select="format-number($Total_Pages,'#.#')"/>
> >
> > I need to be able to control which way the number is rounded up or down
..is there a function for this? .. oh im using MSXML 4.0..
> >
> > Thanks
> >
> > Paul Mortimer
>
> --
>
> System Development
> VIRBUS AG
> Fon  +49(0)341-979-7411
> Fax  +49(0)341-979-7409
> joerg.heinicke@virbus.de
> www.virbus.de
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]