PDA

View Full Version : Need format formula, for custom float


aLTeR
25/09/2013, 05:54 PM
I need to format float (for example 456.08 to 000456.08, 632.8 to 000632.80)

TonyII
25/09/2013, 06:04 PM
What do you mean, like this?

new Float:X,Float:Y,Float:Z;
format(string, sizeof(string),"000%f 000%f 000%f", X,Y,Z);

aLTeR
25/09/2013, 06:05 PM
No, something like %02d

Konstantinos
25/09/2013, 06:05 PM
Using:

%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.

%06.2f


From a test, it works but I don't know if it's used like that.

aLTeR
25/09/2013, 06:07 PM
Thanks Konstantinos.