round: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\[\[Category:[ _]?Scripting[ _]Commands[ _]Armed[ _]Assault(\|.*)]]" to "{{GameCategory|arma1|Scripting Commands}}") |
Lou Montana (talk | contribs) m (Text replacement - "\[\[Category:[ _]?Scripting[ _]Commands[ _]Arma[ _]2(\|.*)\]\]" to "{{GameCategory|arma2|Scripting Commands}}") |
||
Line 37: | Line 37: | ||
{{GameCategory|arma1|Scripting Commands}} | {{GameCategory|arma1|Scripting Commands}} | ||
[[Category:Command_Group:_Math|{{uc:{{PAGENAME}}}}]] | [[Category:Command_Group:_Math|{{uc:{{PAGENAME}}}}]] | ||
{{GameCategory|arma2|Scripting Commands}} | |||
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]] | [[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]] | ||
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]] | [[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]] |
Revision as of 06:24, 9 January 2021
Description
- Description:
- Rounds up or down to the closest integer.
- Groups:
- Math
Syntax
Examples
- Example 1:
_val= round 5.25, result is 5
- Example 2:
_val= round 5.55, result is 6
Additional Information
- See also:
- ceilfloorlinearConversionMath Commands
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
Notes
Bottom Section
- Posted on February 23, 2018 - 05:21 (UTC)
- feint
- If you want to round to a specific place past the decimal point, use toFixed and parseNumber together.
For example:parseNumber (3.16666 toFixed 1); // 3.2
- Posted on April 3, 2018 - 21:33 (UTC)
- Lou Montana
- Before toFixed 1.66 and parseNumber 1.00, you could round with decimals with a dirty little "hack": (round ((getDir player) * 100)) / 100