get the first 4 digits of x,y,z without float round
#1

how do you do it?
Reply
#2

Do you want Example: 5.153454 to be readed just as 5.1534 ?

pawn Код:
format(string,sizeof(string),"%.4f, %.4f, %.4f ", X, Y, Z); //instead of %f do %.(num of digits)f
Reply
#3

no only 5 nothing else after it. eg: 2444.12342, i want it as only 2444
Reply
#4

try
pawn Код:
%0.f
Reply
#5

or
pawn Код:
"%.0f"
EDIT: I guess he means, round a float without using floatround. And I guess his coordinates are > 1000 so, he has four digits. That's what I think.
Reply
#6

works thanks you
Reply
#7

i actually wanted the numbers before the decimal sry
Reply
#8

Quote:
Originally Posted by THE_KNOWN
Посмотреть сообщение
i actually wanted the numbers before the decimal sry
If you want to transform a floating point to an <integer> in a string you should do what ******, RyDer' and SwisT said
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)