SA-MP Forums Archive
Can someone explain this - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Can someone explain this (/showthread.php?tid=245973)



Can someone explain this - Steve M. - 02.04.2011

Hello guys!

Can someone explain me what this %02d does in this code:
Код:
format(str, 32, "%02d:%02d", var1, var2);



AW: Can someone explain this - Nero_3D - 02.04.2011

%d or %i insert a number into the string

the 2 tells the function that the number always need to be 2 cells long

the 0 before the 2 just tells the function to use a 0 instead of a space if the number doesnt use 2 cells