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

RE: xsl mathematical calculation

Subject: RE: xsl mathematical calculation
From: "Andrew Welch" <andrew@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 12 Feb 2002 15:17:36 -0000
mathematical calculation
Hi,

You can use div and mod to work this out.  Div basically is divide, while
mod gives the remainder.  Div will return a decimal, so you need to find its
floor.

So if variable $duration holds the number 130:

<xsl:value-of select="floor($duration div 60)"/>

will return 2

<xsl:value-of select="$duration mod 60"/>

will return 10


cheers

andrew

===



>  -----Original Message-----
> From: 	stevenson [mailto:stevenson@xxxxxxxxxxxxxxxxxxxxxx]
> Sent:	Tuesday, February 12, 2002 10:20 AM
> To:	xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Cc:	andrew@xxxxxxxxxxxxxxxxxxxxxxx
> Subject:	xsl mathematical calculation
>
> i have 130 minutes
> What i want to do is to do a calculation and output it in terms of hours
and minutes i.e
>
> 2Hrs, 10 Mins.
>
> How can i do that?
>
> Can someone assist
>
> Stevenson Ngila
> Footman-Walker Associates Ltd
>
>


 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.