SA-MP Forums Archive
2 character integer from one - 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: 2 character integer from one (/showthread.php?tid=230386)



2 character integer from one - MP2 - 23.02.2011

I have two integers - minutes and seconds but the seconds are like 0 1 2 3 4 5 6 7 8 9 10 etc., but I want it to display as '1:03' for example. I know it's something like %02i or something, but that wont work for me. Any help appriciated.

Please don't suggest that I use if < 10 add a 0, because I don't want to do that.


Re: 2 character integer from one - MadeMan - 23.02.2011

pawn Код:
format(string, sizeof(string), "%02i:%02i", seconds/60, seconds%60);



Re: 2 character integer from one - MP2 - 23.02.2011

Yeah, it works. I forgot to GMX, sorry.


Re: 2 character integer from one - maramizo - 23.02.2011

*cough*
What's GMX?


AW: Re: 2 character integer from one - Kmitska - 23.02.2011

Quote:
Originally Posted by maramizo
Посмотреть сообщение
*cough*
What's GMX?
GMX = restarting command (rcon) for samp