SA-MP Forums Archive
Need format formula, for custom float - 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: Need format formula, for custom float (/showthread.php?tid=466049)



Need format formula, for custom float - aLTeR - 25.09.2013

I need to format float (for example 456.08 to 000456.08, 632.8 to 000632.80)


Re: Need format formula, for custom float - TonyII - 25.09.2013

What do you mean, like this?
pawn Код:
new Float:X,Float:Y,Float:Z;
format(string, sizeof(string),"000%f 000%f 000%f", X,Y,Z);



Re: Need format formula, for custom float - aLTeR - 25.09.2013

No, something like %02d


Re: Need format formula, for custom float - Konstantinos - 25.09.2013

Using:
pawn Код:
%06f
makes it like that you want. However, if you want to add the last to digits (after dot) to 2 digits, that might work.
pawn Код:
%06.2f
From a test, it works but I don't know if it's used like that.


Re: Need format formula, for custom float - aLTeR - 25.09.2013

Thanks Konstantinos.