---
url: >-
  https://game-engine-io.github.io/enginex-frontend-sdk/reference/api/@getenginex/sdk/functions/fromMinorUnits.md
---
[Reference](../../../index.md) / [@getenginex/sdk](../index.md) / fromMinorUnits

# fromMinorUnits()

> **fromMinorUnits**(`amountMinor`, `currency`): `number`

Converts minor units into the main unit, as a `number`: `1999` → `19.99`. Use it to
show in edit fields or charts; to display money to the user use [formatMoney](formatMoney.md).
The result is the `number` closest to the decimal value: above ~15 significant digits (e.g.
`9007199254740991` with 2 decimal places) the `number` no longer represents the decimal places.

## Parameters

### amountMinor

`number`

Amount in minor units (a safe integer).

### currency

[`CurrencyInfo`](../interfaces/CurrencyInfo.md)

The operator's currency (`config.currency`).

## Returns

`number`

## Example

```ts
fromMinorUnits(1999, currency) // 19.99
```

## Throws

`amountMinor` is not a safe integer or `decimalPlaces` is invalid.
