Jump to content

When doing addition, how to have it output a leading zero?


ghurty

Recommended Posts

I have two variables that I am adding to each other

$time = $num1+$num2;

 

Sometimes $num1 will have a leading zero (ex: 0410) but it will always be four digits long.

 

The way it is now, if there is a leading zero, it outputs $time as a three digit number without the leading zero. How can I have it that it will output it as a four digit number?

 

 

Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.