[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: xsl 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
|
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
|