MIST roundTbl

From DCS World Wiki - Hoggitworld.com


Added with: Mist 4.1
This function rounds all values on the first level of a table to the desired amount. Numbers within nested tables will be ignored. 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).
table mist.utils.roundTbl(table numbers )
Valid Input Values:
table with numbers
Return value:
Return example:
Usage Examples:
The following will return a vec3 table of the units current position rounded to tenths of a meter.


local point = mist.utils.roundTbl(Unit.getByName('myUnit').getPosition().p, 1)


Related Functions
converter, toDegree, toRadian, round, roundTbl, metersToNM, metersToFeet, NMToMeters, feetToMeters, mpsToKnots, mpsToKmph, knotsToMps, kmphToMps, kelvinToCelsius, FahrenheitToCelsius, celsiusToFahrenheit

Scripting Engine

MIST Root Page