Need format formula, for custom float
#1

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

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);
Reply
#3

No, something like %02d
Reply
#4

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.
Reply
#5

Thanks Konstantinos.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)