Bitcoin
A$ 88,068
WINkLink
A$ 0.0008640
Ethereum
A$ 5,546.2

How to get _integer_ satoshi values from JSON RPC?

It seems that RPC calls for getting JSON information on a block return “value” fields in bitcoins, not in satoshis.
This means that there is a conversion from integer to float somewhere, which is disturbing since it may introduce rounding errors.

Is there a way to get the integer satoshi values directly in the JSON?

Otherwise, is it completely safe to just multiply the float value by 10^8 and take the integer part?

Is there a better way to directly obtain the integer satoshi value?

Thanks!


Let me give some context.

My concern is that, for instance, most systems have no float of value 0.1; they generally have a (tiny) difference.

On my machine, for instance:

python3.6 -c 'print("%.20f"%0.1)'
0.10000000000000000555

python3.6 -c 'print(0.1+0.1+0.1==.3)'
False

This is generally safe, but in my context this raises messy issues, so dealing with integers only is appealing.

Related Posts

Leave a Reply

Subscribe To Newsletter

For updates and exclusive offers, enter your e-mail below.

Donate To Cryptonic Australia


Donate BTC: 1MPYuHUKm3AhNivMSngqLnoEbpNEecHeEK
Donate Doge: DDYybw7H8zx8EYU74JrGW8WwmYh9AGuyMC
Donate WinK: TDiXutqKE3P17LpZMQh3SDBCGSkAC6iEjB




Bounce (AUCTION) is now available on Coinbase
October 20, 2021
Bitcoin Leads Charge Of Large Cap Altcoin Dominance In October
October 20, 2021
LUNA Outperforms Bitcoin’s Rally, Why It’s Prepared For Large Beneficial properties
October 20, 2021




Bounce (AUCTION) is now available on Coinbase
October 20, 2021
Bitcoin Leads Charge Of Large Cap Altcoin Dominance In October
October 20, 2021
LUNA Outperforms Bitcoin’s Rally, Why It’s Prepared For Large Beneficial properties
October 20, 2021


CryptoCurrencyAUDChange 1hChange 24hChange 7d
Bitcoin88,068 0.15 % 2.67 % 17.58 %
Ethereum5,546.2 0.68 % 7.38 % 19.25 %
Binance Coin666.81 0.21 % 2.65 % 13.89 %
Cardano2.920 0.35 % 3.70 % 3.62 %
Tether1.330 0.02 % 0.00 % 0.21 %
XRP1.520 0.31 % 4.46 % 3.79 %
Solana231.90 1.16 % 11.53 % 14.75 %
Polkadot59.30 0.35 % 7.68 % 26.96 %
Dogecoin0.3384 0.31 % 3.23 % 12.44 %
USD Coin1.330 0.07 % 0.21 % 0.17 %

Recent Comments

Allison wick

I was a victim of WDC Markets investment scam some months ago myself. It was...

Greatness

he is the best when it comes to recovery, he helped recover my funds without...

URL

... [Trackback] [...] There you will find 63491 more Infos: cryptonic.com.au/evaluation-suggests-bitcoin-robust-palms-are-shopping-for-this-dip/ [...]