mr_burns wrote:
Hi,
I am tryin to format a number from, for example, 1 to '01'. How is this done? Cheers
Burnsy
From the PHP docs:
" kennyc at horizondigital dot com
14-Jun-2002 07:57
ONELINE LEADING ZERO ADDER: I kept getting frustrated by php's weak number
formatting functions and using the recursive leading zero adders that I've seen
in other people code, so here's my quick and easy oneliner for adding leading
zero's to any number:
Two digit space:
substr($num+100,1);
0=00
5=05
23=23
3.14=03.14
Four digit space:
substr($num+10000,1);
0=0000
5=0005
23=0023
256=0256
4096=4096
98.6=0098.6
You may want to check first to be sure that your number dosen't already exceed
it's character size!"
quite ingenious I might add.. I actually wrote this a couple of hours ago, just
forgot to send it... sorry for the delay...
--
Michael Austin.
Consultant - NOT Available.
Donations STILL welcomed.
Http://www.firstdbasource.com/donations.html
:)