round: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " {2,}\}\}" to " }}")
m (Text replacement - "{{Command " to "{{RV|type=command ")
Line 1: Line 1:
{{Command
{{RV|type=command


| arma1
| arma1

Revision as of 12:31, 23 January 2021

Hover & click on the images for description

Description

Description:
Description needed
Groups:
Math

Syntax

Syntax:
Syntax needed
Parameters:
x: Number
Return Value:
Return value needed

Examples

Example 1:
_val= round 5.25, result is 5
Example 2:
_val= round 5.55, result is 6

Additional Information

See also:
See also needed

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
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 Arma 3 logo black.png1.66 and parseNumber Logo A1 black.png1.00, you could round with decimals with a dirty little "hack": (round ((getDir player) * 100)) / 100