Skip to main content

HBAR from:

Construct HBAR from different representations.

HBAR to:

Convert HBAR to a different unit/format.

HBAR constants:

Provided constant values of HBAR.

HBAR units

Modify the HBAR representation to one of the HBAR denominations.

HBAR decimal places

The decimal precision of HBAR varies across the different Hedera APIs. While HAPI, JSON-RPC Relay, and Hedera Smart Contract Service (EVM) provide 8 decimal places, the msg.value in JSON-RPC Relay provides 18 decimal places.
APIDecimal
Hedera API (HAPI) (Crypto + SCS Service (msg.value))8
Hedera Smart Contract Service (EVM)8
JSON RPC Relay (passed as arguments)8
JSON RPC Relay (msg.value)18
Note: The JSON-RPC Relay msg.value uses 18 decimals when it returns HBAR. As a result, the gasPrice also uses 18 decimal places since it is only utilized from the JSON-RPC Relay.