ellcon
07-25-2002, 02:23 PM
Hi, I need to know how to append a zero to the front of a number. For example, how to change 6 into 06.
Thanks
-Ian
tamienne
07-25-2002, 02:30 PM
iNum = 6;
paddedNum = "0" + iNum;
===============
iNum = 6;
iPaddedLength = 2;
paddedNum = ""+iNum;
while (paddedNum.length < iPaddedLength) {
paddedNum = "0" + paddedNum;
}
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.