I am trying to make a minutes dropdown. How do I make it come out as 01, 02, 03, 04, 05, 06, 07 08, 09, 10, 11, 12
, etc.? Right now the first 9 numbers only come out as 1, 2, 3, 4, 5, 6, 7, 8, 9
.
<select id="minutes">
<cfloop from="1" to="60" index="m">
<option>#m#</option>
</cfloop>
</select>
Well, I understand why it's doing what it's doing and was expecting it anyway. Haha. Just wondered if there was a way of getting the 0s to come up without having to manually create 01-09 options.
You can use
numberFormat
.See also this runnable example at trycf.com.