Raised This Month: $ Target: $400
 0% 

convert a Float to normal number (integer?)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wouter
Senior Member
Join Date: Feb 2005
Location: Belgium
Old 05-08-2006 , 12:01   convert a Float to normal number (integer?)
Reply With Quote #1

well i have an error wish is tag mismatch and i need to make a float to a normal number (1; 2; 3; 99; ...).

or a normal number to a float i can use to.

thx
wouter is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 05-08-2006 , 12:03  
Reply With Quote #2

if you have a float you use round() to get the int. to get an int into a float use float( int )
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 05-08-2006 , 12:04  
Reply With Quote #3

Quote:
Originally Posted by Suicid3
if you have a float you use round() to get the int. to get an int into a float use float( int )
*cough* floatround( /*IN*/ Float: ) *cough*
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 05-08-2006 , 12:05  
Reply With Quote #4

oops....see what happens when you toggle different languages?
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
wouter
Senior Member
Join Date: Feb 2005
Location: Belgium
Old 05-08-2006 , 12:05  
Reply With Quote #5

so
Code:
 round(12.0) // return 12
wouter is offline
FatalisDK
Senior Member
Join Date: Mar 2006
Location: bacon
Old 05-08-2006 , 13:03  
Reply With Quote #6

Code:
new Num = floatround(12.0) // Num = 12
Code:
new Num = floatround(12.5) // Num = 13
Code:
new Num = floatround(12.1) // Num = 12

http://www.amxmodx.org/funcwiki.php?...ound&go=search
__________________
FatalisDK is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 05-08-2006 , 13:14  
Reply With Quote #7

wouter: i see some of your questions related to amxx includes.
So a hint: try search for such things in includes/funcwiki, for example there you can find different rounding methods.
VEN is offline
wouter
Senior Member
Join Date: Feb 2005
Location: Belgium
Old 05-08-2006 , 13:25  
Reply With Quote #8

sorry bout that will try in future
wouter is offline
Reply


Thread Tools
Display Modes

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 05:13.


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