# convertToRawAmount · FT4 TypeScript client · Chromia Docs (concept)

> convertToRawAmount(num: bigint | SupportedNumber , decimals?: number): RawAmount Convert a SupportedNumber or RawAmount into RawAmount with optional specif

Source: https://docs.chromia.com/pages/ft4-ts-client/functions/asset.convertToRawAmount/

Function

# convertToRawAmount

* ```signature
  convertToRawAmount(num: bigint | SupportedNumber, decimals?: number): RawAmount
  ```

  Convert a SupportedNumber or RawAmount into RawAmount with optional specified decimals.
  The function throws error under these conditions:

  + When the input number is not a base-10 number.
  + When the specified decimals is not an integer number between 0 and 78 (inclusive).
  + When the decimals argument is incompatible with num.decimals.
  + When the calculated value is out of range.

  #### Parameters

  + num: bigint | [SupportedNumber](https://docs.chromia.com/pages/ft4-ts-client/types/asset.SupportedNumber/)

    The input number to convert.
  + `Optional`decimals: number

    The optional number of decimals to use for the conversion.

  #### Returns [RawAmount](https://docs.chromia.com/pages/ft4-ts-client/types/asset.RawAmount/)

  + The converted RawAmount.

  #### Throws

  Will throw an error if the input number is not a base-10 number or the specified decimals is invalid.

[View this page on docs.chromia.com](https://docs.chromia.com/pages/ft4-ts-client/functions/asset.convertToRawAmount.html)Generated API reference, mirrored from the live docs
