Copy link to clipboard
Copied
Im wanting to convert seconds to hours, mins, secs. This code works fine
<cfset Time = '#int((seconds/60)/60)#:' & '#(seconds/60) MOD 60#:' & '#seconds MOD 60#'>
but if there is a single digit it only displays one eg 1:1:1 whereas I would prefer to have 01:01:01. How can I add a 0 in if its a sigle digit number?
Copy link to clipboard
Copied
numberFormat() can provide zero-padding:
http://help.adobe.com/en_US/ColdFusion/10.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-72c8.html
--
Adam
Find more inspiration, events, and resources on the new Adobe Community
Explore Now