Raised This Month: $ Target: $400
 0% 

How to round number like 1.264


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alter
Member
Join Date: Jan 2013
Location: Lithuainia
Old 01-23-2013 , 06:55   How to round number like 1.264
Reply With Quote #1

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

Last edited by alter; 01-23-2013 at 06:56.
alter is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-23-2013 , 06:58   Re: How to round number like 1.264
Reply With Quote #2

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.
__________________
Arkshine is offline
alter
Member
Join Date: Jan 2013
Location: Lithuainia
Old 01-23-2013 , 07:20   Re: How to round number like 1.264
Reply With Quote #3

Thanks.
alter is offline
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 20:33.


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