6

When i run the curl command:

curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getbalance"}' -H 'Content-Type: application/json'

It gives me a balance like so:

{
  "id": "0",
  "jsonrpc": "2.0",
  "result": {
    "balance": 140000000000,
    "unlocked_balance": 50000000000
  }
}

It's just one big integer, how do i convert it into the real balance?

It impossible to just add a decimal place because i don't what the actual balance is.

5

The "human friendly" amounts have a decimal place at 12 digits, so in this case, 140000000000 atomic units would be 0.140000000000 monero.

1

To simplify user36303's answer, divide the reported amount by 1,000,000,000,000 (one trillion).

0

The amount is given in piconero. From Moneropedia:

Atomic Units refer to the smallest fraction of 1 XMR. One atomic unit is currently 1e-12 XMR (0.000000000001 XMR, or one piconero). It may be changed in the future.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.