Raised This Month: $ Target: $400
 0% 

Convert a flot number to the entire inmediate number?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
_lol_
Senior Member
Join Date: Apr 2009
Old 05-07-2009 , 13:19   Convert a flot number to the entire inmediate number?
Reply With Quote #1

how to show in my print an entire numbre?example:

PHP Code:
new idontknow 11
New Floatfloat
float 
idontknow*1.2

client_print
(idprint_center"the number is %d"float
Yeah, it will show in the print 13.2 (i think)but i dont want 13.2 i want 14.

how to do it?lol
_lol_ is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 05-07-2009 , 13:30   Re: Convert a flot number to the entire inmediate number?
Reply With Quote #2

Quote:
Originally Posted by _lol_ View Post
how to show in my print an entire numbre?
PHP Code:
new Floatfloat_f 0.00213;
client_print(idprint_chat"Float here: %f"float_f); 
Quote:
Originally Posted by _lol_ View Post
but i dont want 13.2 i want 14.
PHP Code:
new Floatfloat_f 0.00213;
client_print(idprint_chat"Integer here: %d"floatround(float_f2)); 
There's also different flags in floatround, you may want check them out.
http://www.amxmodx.org/doc/index.htm...floatround.htm
SnoW is offline
Send a message via MSN to SnoW
SchlumPF*
Veteran Member
Join Date: Mar 2007
Old 05-07-2009 , 13:37   Re: Convert a flot number to the entire inmediate number?
Reply With Quote #3

dont use ints as params, use the constant!
floatround_floor - 4.9 -> 4.0 (round down)
floatround_round - 4.4 -> 4.0, 4.5 -> 5.0 (round to the nearest int)
floatround_ceil - 4.1 -> 5.0 (round up)
__________________
SchlumPF* is offline
Send a message via ICQ to SchlumPF*
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 05-07-2009 , 14:03   Re: Convert a flot number to the entire inmediate number?
Reply With Quote #4

Quote:
Originally Posted by SchlumPF* View Post
dont use ints as params, use the constant!
I hope you mean unless the ints are not known...
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
SchlumPF*
Veteran Member
Join Date: Mar 2007
Old 05-07-2009 , 18:43   Re: Convert a flot number to the entire inmediate number?
Reply With Quote #5

Quote:
Originally Posted by Dores View Post
I hope you mean unless the ints are not known...
ofc i meant that, you should have known what i mean but for beginners i expressed myself wrong :X
__________________
SchlumPF* is offline
Send a message via ICQ to SchlumPF*
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 05-07-2009 , 23:13   Re: Convert a flot number to the entire inmediate number?
Reply With Quote #6

Quote:
Originally Posted by Dores View Post
I hope you mean unless the ints are not known...
Even if they are known, using the constants provide easier reading for everybody.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 05-08-2009 , 08:25   Re: Convert a flot number to the entire inmediate number?
Reply With Quote #7

Quote:
Originally Posted by YamiKaitou View Post
Even if they are known, using the constants provide easier reading for everybody.
That doesn't conflict with what I said.
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 05-08-2009 , 10:33   Re: Convert a flot number to the entire inmediate number?
Reply With Quote #8

Hiz guys. Aye, somehow I just remembered the int better than the constant lolz.
SnoW is offline
Send a message via MSN to SnoW
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:27.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode