Express a float number as an integer?
#1

So I fixed my previous error with the help of a forum member, but I ran into an issue with float numbers:



What I'd like is a way to express that number as an integer between 0 and 1000 (like a default vehicle health integer).

I believe what you see is what you get, the vehicle health is expressed as a float, and formatted into a textlabel. I want the text label number to show 0-1000 and I don't know how to do that. Seeing my script shouldn't be necessary.
Reply
#2

You don't want any number after the decimal. You simply do this.

pawn Код:
format(string[], sizeof(string[]), "%.0f", args);
Reply
#3

Quote:
Originally Posted by Patrick_
Посмотреть сообщение
You don't want any number after the decimal. You simply do this.

pawn Код:
format(string[], sizeof(string[]), "%.0f", args);
Yup, thanks. I'm not thinking clearly this afternoon lol
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)