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?
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.