AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   convert a Float to normal number (integer?) (https://forums.alliedmods.net/showthread.php?t=28145)

wouter 05-08-2006 12:01

convert a Float to normal number (integer?)
 
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

Xanimos 05-08-2006 12:03

if you have a float you use round() to get the int. to get an int into a float use float( int )

Greenberet 05-08-2006 12:04

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*

Xanimos 05-08-2006 12:05

oops....see what happens when you toggle different languages?

wouter 05-08-2006 12:05

so
Code:
 round(12.0) // return 12

FatalisDK 05-08-2006 13:03

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

VEN 05-08-2006 13:14

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.

wouter 05-08-2006 13:25

sorry bout that will try in future :oops:


All times are GMT -4. The time now is 05:13.

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