[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: format-number and time or ???
Earlier I wrote: concat(format-number($hours,'#0'),':', format-number($minutes,'00'),':', format-number($seconds,'00.###')) If you start with $data containing the amount of time in seconds, $seconds is ($data mod 60) $minutes is ((floor($data div 60)) mod 60) $hours is (floor($data div 3600)) If you start with $data containing the amount of time in minutes, $seconds is (($data * 60) mod 60) $minutes is (floor($data) mod 60) $hours is (floor($data div 60)) If you start with $data containing the amount of time in hours, $seconds is (($data * 3600) mod 60) $minutes is (floor($data * 60) mod 60) $hours is (floor($data)) The above formulae allow decimal fractions of a second to fall through, which you'll trim in the formatting anyway. They also allow $hours to be arbitrarily large, so you may want to expand the format string (###0) or add another calculation for days. .................David Marston 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
|