SA-MP Forums Archive
make 52.73477 to 52.73 - 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: make 52.73477 to 52.73 (/showthread.php?tid=640480)



make 52.73477 to 52.73 - SetPlayerNameTag - 03.09.2017

im stucking here, rly need help!


Re: make 52.73477 to 52.73 - Kane - 03.09.2017

What're you asking? If you're referring to floats, use: " .2f ".


Re: make 52.73477 to 52.73 - FailerZ - 03.09.2017

It is a float you can use format this way:
PHP код:
new string[25];
new 
Float:num 52.74377;
format(stringsizeof(string), "Number is: %.2f"num);
SendClientMessage(playerid, -1string); 
Код:
 Output:
Number is: 52.74



Re: make 52.73477 to 52.73 - 10MIN - 03.09.2017

Maybe this would help:
PHP код:
new Float:myfloat 52.734477;
new 
str[10];
fomat(mystr,10,"%.2f",myfloat);
new 
Float:newfloat floatstr(mystr); 
E: Didn't seen other answers


Re: make 52.73477 to 52.73 - SetPlayerNameTag - 03.09.2017

thx all, solved