SA-MP Forums Archive
1.234 - 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)
+--- Thread: 1.234 (/showthread.php?tid=650740)



1.234 - PepsiCola23 - 05.03.2018

so i have a message that tells you how many kilometers you`ve done.

PHP код:
 made a total of  %d km. .", PGarbageCurrent[playerid]/1000 
but it doesnt sho as this format : 1.234 KM . How to format it to show like that?


Re: 1.234 - [WSF]ThA_Devil - 05.03.2018

Use '%f' (float) instead of '%d' (integer)


Re: 1.234 - GaByM - 05.03.2018

Also, you can use
PHP код:
 "made a total of  %.1f km" // will show 1.2 KM
"made a total of  %.2f km" // will show 1.23 KM 



Re: 1.234 - PepsiCola23 - 05.03.2018

i used a function called decimal,thank you all !