BIS fnc convertUnits: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (template:command argument fix)
m (template:command argument fix)
Line 34: Line 34:
| [value, from, to, mode, precision] call [[BIS_fnc_convertUnits]] |SYNTAX=
| [value, from, to, mode, precision] call [[BIS_fnc_convertUnits]] |SYNTAX=


|p1= value: [[Number]] - source value |= Parameter 1
|p1= value: [[Number]] - source value |PARAMETER1=


|p2= from: [[Number]] - source unit. Can be one of:
|p2= from: [[Number]] - source unit. Can be one of:
Line 46: Line 46:
* 7: mph (miles per hour)
* 7: mph (miles per hour)
* 8: nm (nautical miles)
* 8: nm (nautical miles)
* 9: kts (knots) |= Parameter 2
* 9: kts (knots) |PARAMETER2=


|p3= to: [[Number]] - (Optional, default detected system of units ''via'' [[systemOfUnits]]) destination unit. See ''from''. |= Parameter 3
|p3= to: [[Number]] - (Optional, default detected system of units ''via'' [[systemOfUnits]]) destination unit. See ''from''. |PARAMETER3=


|p4= mode: [[Number]] - (Optional, default 0) can be one of:
|p4= mode: [[Number]] - (Optional, default 0) can be one of:
* 0: destination value (Scalar)
* 0: destination value (Scalar)
* 1: destination text long (String) e.g "5 meters"
* 1: destination text long (String) e.g "5 meters"
* 2: destination text short (String) e.g "5 m" |= Parameter 4
* 2: destination text short (String) e.g "5 m" |PARAMETER4=


|p5= precision: [[Number]] - (Optional, default 1) destination precision factor, -1 for no precision change. '''cannot be 0''' |= Parameter 5
|p5= precision: [[Number]] - (Optional, default 1) destination precision factor, -1 for no precision change. '''cannot be 0''' |PARAMETER5=


| [[Number]] or [[String]] - converted value |RETURNVALUE=
| [[Number]] or [[String]] - converted value |RETURNVALUE=
____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= <code>_distString = [500, 0, 5, 1, -1] [[call]] [[BIS_fnc_convertUnits]];</code> |= Parameter 1
|x1= <code>_distString = [500, 0, 5, 1, -1] [[call]] [[BIS_fnc_convertUnits]];</code> |PARAMETER1=
____________________________________________________________________________________________
____________________________________________________________________________________________



Revision as of 15:28, 7 April 2019


Hover & click on the images for description

Description

Description:
Converts values to a target system of units.
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
[value, from, to, mode, precision] call BIS_fnc_convertUnits
Parameters:
value: Number - source value
from: Number - source unit. Can be one of:
  • 0: m (meters)
  • 1: km (kilometers)
  • 2: ms (meters per second)
  • 3: kmh (kilometers per hour)
  • 4: ft (feet)
  • 5: mi (miles)
  • 6: fts (feet per second)
  • 7: mph (miles per hour)
  • 8: nm (nautical miles)
  • 9: kts (knots)
to: Number - (Optional, default detected system of units via systemOfUnits) destination unit. See from.
mode: Number - (Optional, default 0) can be one of:
  • 0: destination value (Scalar)
  • 1: destination text long (String) e.g "5 meters"
  • 2: destination text short (String) e.g "5 m"
precision: Number - (Optional, default 1) destination precision factor, -1 for no precision change. cannot be 0
Return Value:
Number or String - converted value

Examples

Example 1:
_distString = [500, 0, 5, 1, -1] call BIS_fnc_convertUnits;

Additional Information

See also:
systemOfUnits

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