Skip to content

Awkard-ish notation of getbalance() #330

Answered by mccwdev
Namekinek0 asked this question in Q&A
Discussion options

You must be logged in to vote

The getbalance() method returns the value in Satoshi's, the smallest denominator for Bitcoin.

You can get the value in bitcoins by dividing by 100000000 or 10**8:

>>> amount / 10**8 
0.00006691

Or you could use bitcoinlib Value class to conveniently display values

>>> from bitcoinlib.values import Value
>>> Value.from_satoshi(6691, 1).str()
'0.00006691 BTC'

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Namekinek0
Comment options

Answer selected by Namekinek0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants