round - ryzom/ryzomcore GitHub Wiki


title: Round description: published: true date: 2023-03-12T17:40:38.581Z tags: editor: markdown dateCreated: 2023-03-12T17:40:34.751Z

round

The round native AI script function is used to round a float value to the closest integer value.

Syntax

(value: f)round(value: f) // round_f_f

Arguments

  • value (float): The float value to be rounded.

Return value

  • rounded_value (float): The closest integer value to the input value.

Example

(count)round(4.7); // returns 5 

This example code calls the round function with a float value of 4.7 and returns the closest integer value, which is 5.

⚠️ **GitHub.com Fallback** ⚠️