BIS fnc convertUnits: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "<code>\[\[private\]\] (_?[a-zA-Z0-9_]+) = \[([^\[]*)\] \[\[(call|spawn)\]\] \[\[(BI(N|S)_fnc_[a-zA-Z0-9_]+)\]\];?<\/code>" to "<sqf>private $1 = [$2] $3 $4;</sqf>") |
Lou Montana (talk | contribs) m (Text replacement - " ''via'' " to " via ") |
||
(One intermediate revision by the same user not shown) | |||
Line 11: | Line 11: | ||
|descr= Converts values to a target system of units. | |descr= Converts values to a target system of units. | ||
|s1=[value, from, to, mode, precision] call [[BIS_fnc_convertUnits]] | |s1= [value, from, to, mode, precision] call [[BIS_fnc_convertUnits]] | ||
|p1= value: [[Number]] - source value | |p1= value: [[Number]] - source value | ||
Line 27: | Line 27: | ||
* 9: kts (knots) | * 9: kts (knots) | ||
|p3= to: [[Number]] - (Optional, default detected system of units | |p3= to: [[Number]] - (Optional, default detected system of units via [[systemOfUnits]]) destination unit. See ''from''. | ||
|p4= mode: [[Number]] - (Optional, default 0) can be one of: | |p4= mode: [[Number]] - (Optional, default 0) can be one of: |
Latest revision as of 11:44, 21 February 2025
Description
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:
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