---
name: "BIS_fnc_convertUnits"
type: function
status: ok
groups: ["Math"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_convertUnits
revid: 370880
updated: 2025-02-21T10:44:03Z
---

# BIS_fnc_convertUnits

*Function · Math · Arma 3 v0.50 · introduced in Take On Helicopters v1.00*

## Description

Converts values to a target system of units.

## Syntax

```sqf
[value, from, to, mode, precision] call BIS_fnc_convertUnits
```

**Parameters:**

- `value`: [Number](../topics/Number.md) - source value
- `from`: [Number](../topics/Number.md) - 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](../topics/Number.md) - (Optional, default detected system of units via [systemOfUnits](../commands/systemOfUnits.md)) destination unit. See *from*.
- `mode`: [Number](../topics/Number.md) - (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](../topics/Number.md) - (Optional, default 1) destination precision factor, -1 for no precision change. **cannot be 0**

**Returns:** [Number](../topics/Number.md) or [String](../topics/String.md) - converted value

## Examples

### Example 1

```sqf
private _distString = [500, 0, 5, 1, -1] call BIS_fnc_convertUnits;
```

## See also

[systemOfUnits](../commands/systemOfUnits.md)

<sub>Source: [BI Community Wiki — BIS fnc convertUnits](https://community.bistudio.com/wiki/BIS_fnc_convertUnits) (revision 370880).</sub>
