Posted by Richard Scrivens on 05/10/05 12:31
You could use something like:
while(strlen($myNumber) < 4){
$myNumber = "0" . $myNumber;
}
"Terje" <terje@cyberfactory.no> wrote in message
news:vV_fe.9641$SL4.218285@news4.e.nsc.no...
> Here in norway we have a four digit postalnumber, often this is 7800 an so
> on. But in some parts of norway we have 511 an postalnumber with 2-3
> numbers. The problem is that I need to display the 511 as a four digit
> number like 0511. Is there anyway I can set the length of an int string?
>
> Terje
>
>
Navigation:
[Reply to this message]
|