[Help] Float number alignment
#1

pawn Код:
format( myString, sizeof( myString ), " X = %04.02f~n~ Y = %04.02f~n~ Z = %04.02f~n~ A = %03.02f", c_x, c_y, c_z, c_a );
(It's gonna be used on a TextDraw, thats why I'm using ~n~ instead of \n)

I want it to show like:

Quote:

X = 0960.01
Y = 1000.50
Z = 0007.08
A = 050.80

I managed to do it with Integers, but how can I do it with Float points?

Thanks in advance.

EDIT#_____________________________________________ ______________

I am sorry, I should have explained a little more specific of what I wanted.

Imagine a digital clock:

Quote:

08:36 h
04:05 h

If you notice, it always shows a zero even if the hours/minutes value is below 10.
Quote:

X = 0960.01
Y = 1000.50
Z = 0007.08
A = 050.80

( the Angle never goes up from 360 so, I just want it to show 3 algoritms.

That's why I mentioned that I managed to do it with integers, if you do:
pawn Код:
printf( "%03d", 12 );
It will print:
Quote:

012

Reply


Messages In This Thread
[Help] Float number alignment - by Proxyded - 09.12.2010, 02:04
Re: [Help] Float number alignment - by willsuckformoney - 09.12.2010, 02:23
Re: [Help] Float number alignment - by The_Gangstas - 09.12.2010, 02:26
Re: [Help] Float number alignment - by Proxyded - 09.12.2010, 15:23
Re: [Help] Float number alignment - by Proxyded - 11.12.2010, 15:39
Re: [Help] Float number alignment - by Slice - 12.12.2010, 12:01

Forum Jump:


Users browsing this thread: 1 Guest(s)