note Help Needed
This wiki is the result of an ongoing community effort — thank you all for helping!
If you want to provide changes to this page then please click here.
floatround
warning
This function starts with a lowercase letter.
Description
Round a floating point number to an integer value.
Name | Description |
---|---|
Float:value | The value to round. |
floatround_method:method | The floatround mode to use. By default: floatround_round |
Returns
The rounded value as an integer.
Examples
new value = floatround(3.3, floatround_ceil);
printf("3.3 rounded to %d", value); // 3.3 rounded to 4
new value = floatround(50.996229);
printf("50.996229 rounded to %d", value); // 50.996229 rounded to 51
new value = floatround(270.0034);
printf("270.0034 rounded to %d", value); // 270.0034 rounded to 270