I don't understand the 02
part of the %02.1f
additional format value of the sprintf()
. I know that .1
is the number of decimal places, but I don't get the 02
part.
echo sprintf('The distance is %02.1f', $this-car->getDistance());
I was looking at https://www.w3schools.com/php/func_string_sprintf.asp and it says that [0-9]
"Specifies the minimum width held of to the variable value" but I don't understand what they mean.
Thank you in advance for any info that I could get.
I was looking at w3schools.com and other search results.