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

format-number and time or ???

Subject: format-number and time or ???
From: Robert Koberg <rob@xxxxxxxxxx>
Date: Fri, 10 Nov 2000 07:30:43 -0800
xsl format number time
First is there a better function to use than format-number when trying to
make numbers look like:
02:59:12
hours:minutes:seconds

My particular need:
I am given a total number of seconds (for example 1000). I convert that to
minutes by:

<xsl:template match="time_remaining">
   <xsl:variable name="t" select="."/>
   <xsl:variable name="t.min" select="format-number(number($t) div
60,'#.00')"/>
   <span class="timeremaining">Time Remaining: <xsl:value-of
select="$t.min"/> minutes</span>
</xsl:template>

How do I set the decimal-point parameter to be ":" instead of "."?

I realize I have some more work to do on determining hours from the minutes
in the code above...

I don't suppose there is an easier way to do this? I have done a search
through the XPath and XSLT specs but could not find any reference to time.


 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.