MIST round

From DCS World Wiki - Hoggitworld.com


mist.utils.round

Added with: Mist 1.0
Description
This function takes a number and returns a rounded version of it. Optional idp defines how many places after the decimal to round the number to; for example, an idp of 2 means the number will be rounded to the nearest hundredth. idp can be negative too, for example, -3 would round to the nearest thousand. If not specified, idp defaults to 0 (rounds to the nearest whole number).
Syntax
number mist.utils.round(number number , number idp )
Valid Input Values:
(25.2343, 1)
Return value:
number
Return example:
25.2
Usage Examples:
local roundedVal = mist.utils.round(145.25436, 2)
Notes:
See Google Unit converter. [1]
Related Functions
converter, toDegree, toRadian, round, roundTbl, metersToNM, metersToFeet, NMToMeters, feetToMeters, mpsToKnots, mpsToKmph, knotsToMps, kmphToMps, kelvinToCelsius, FahrenheitToCelsius, celsiusToFahrenheit, hexToRGB

Scripting Engine

MIST Root Page