AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to round number like 1.264 (https://forums.alliedmods.net/showthread.php?t=206495)

alter 01-23-2013 06:55

How to round number like 1.264
 
How to round number like 1.264
What code to use? I want to make it without comma (1.264 would be like 1)

Arkshine 01-23-2013 06:58

Re: How to round number like 1.264
 
float.inc :

/* Round a float into a integer value */
native floatround(Float:value, floatround_method:method=floatround_round);

/* Different methods of rounding */
enum floatround_method {
floatround_round = 0,
floatround_floor,
floatround_ceil,
floatround_tozero
};

Next time, try to search in the includes first.

alter 01-23-2013 07:20

Re: How to round number like 1.264
 
Thanks.


All times are GMT -4. The time now is 20:33.

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