Do not display decimals (100.00)
#1

I have

Przebieg[i] += 0.05
Gas[i] -= 0.2

and im using a textdraw to show this

new stringPRZEBIEG[128];
format(stringPRZEBIEG,sizeof(stringPRZEBIEG),"%d km",Przebieg[vehicle]);
Textdraw6[playerid] = CreatePlayerTextDraw(playerid,557.000000, 431.000000, stringPRZEBIEG);

how can I show the milage when its done a full mile so insted of 0.05 then 0.1, I just want to see 1, 2 , 3
Reply
#2

Take a look at https://sampwiki.blast.hk/wiki/Floatround . This rounds the float value to the closest full number.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)