SA-MP Forums Archive
Format removing decimals - 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: Format removing decimals (/showthread.php?tid=615197)



Format removing decimals - -eXo - 18.08.2016

This is probably pretty simple, but I'm unable to figure it out. Saving coordinates to an ini file, this seems to remove the decimal from each float, C1X, C1Y, C1Z.. How would I save it as a float?

Код:
format(var, 64, "C1X=%d\n",C1X[playerid]);fwrite(hFile, var);
format(var, 64, "C1Y=%d\n",C1Y[playerid]);fwrite(hFile, var);
format(var, 64, "C1Z=%d\n",C1Z[playerid]);fwrite(hFile, var);



Re: Format removing decimals - Jabern - 18.08.2016

Change the :
PHP код:
%
with :
PHP код:
%
PHP код:
%// = decimal 
%//  = float 
%// = string 



Re: Format removing decimals - -eXo - 18.08.2016

Quote:
Originally Posted by Jabern
Посмотреть сообщение
Change the :
PHP код:
%
with :
PHP код:
%
PHP код:
%// = decimal 
%//  = float 
%// = string 
Wow, very simple.. lol Thank you!


Re: Format removing decimals - WhiteGhost - 18.08.2016

https://sampwiki.blast.hk/wiki/Format