round: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(see also)
m (Text replacement - "\|x([0-9])= *<code>([^<]*)<\/code>" to "|x$1= <sqf>$2</sqf>")
 
(37 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma |= Game name
|game1= arma1
|version1= 1.00


|1.00|= Game version
|game2= arma2
____________________________________________________________________________________________
|version2= 1.00


| Rounds up or down to the closest integer.  |= Description
|game3= arma2oa
____________________________________________________________________________________________
|version3= 1.50


| [[Number]] <nowiki>=</nowiki> '''round''' x |= Syntax
|game4= tkoh
|version4= 1.00


|p1= x: [[Number]] |= Parameter 1
|game5= arma3
|version5= 0.50


| [[Number]] |= Return value
|gr1= Math
____________________________________________________________________________________________
| x1 =<pre>_val= round 5.25, result is 5</pre> | = Example 1
| x2 =<pre>_val= round 5.55, result is 6</pre> | = Example 2
____________________________________________________________________________________________


| [[ceil]], [[floor]], [[linearConversion]], [[Math Commands]]|= See also
|descr= Rounds the provided value to the closest integer.


}}
|s1= [[round]] value
 
|p1= value: [[Number]]
 
|r1= [[Number]]


<h3 style="display:none">Notes</h3>
|x1= <sqf>round 5.25; // returns 5</sqf>
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|x2= <sqf>round -5.25; // returns -5</sqf>
</dl>


<h3 style="display:none">Bottom Section</h3>
|seealso= [[floor]] [[ceil]] [[linearConversion]]
[[Category:Scripting Commands|ROUND]]
}}
[[Category:Scripting Commands ArmA|ROUND]]
[[Category:Command_Group:_Math|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]

Latest revision as of 10:24, 13 May 2022

Hover & click on the images for description

Description

Description:
Rounds the provided value to the closest integer.
Groups:
Math

Syntax

Syntax:
round value
Parameters:
value: Number
Return Value:
Number

Examples

Example 1:
round 5.25; // returns 5
Example 2:
round -5.25; // returns -5

Additional Information

See also:
floor ceil linearConversion

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note