round

From Bohemia Interactive Community
Jump to: navigation, search
Introduced with Armed Assault version 1.00
  

Click on the images for descriptions

Introduced in

Game:
Armed Assault
Version:
1.00

Description

Description:
Rounds up or down to the closest integer.

Syntax

Syntax:
Number = round x
Parameters:
x: Number
Return Value:
Number

Examples

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

Additional Information

Multiplayer:
-
See also:
ceilfloorlinearConversionMath Commands

Notes

Only post proven facts here. Report bugs on the feedback tracker. Use the talk page or the forums for discussions.
Add New Note | How To

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
Introduced with Arma 3 version 1.66
and parseNumber
Introduced with Armed Assault version 1.00
, you could round with decimals with a dirty little "hack":
(round ((getDir player) * 100)) / 100