bitshares / python-bitshares

Fully featured client-side library for the BitShares Blockchain - written entirely in python.

Home Page:http://docs.pybitshares.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Account history have problem with dirty amount data

codefather-labs opened this issue · comments

i need to get clear data from account.history. i use this:

for transfer in account.history(only_ops=["transfer"]):
print(transfer)

its return me transfers this format:

{'id': 'id', 'op': "[0, {'fee': {'amount': 77642, 'asset_id': 'id'}, 'from': '1', 'to': '2', 'amount': {'amount': '30100000000', 'asset_id': '1.3.5351'}, 'memo': {'from': '1', 'to': '2', 'nonce': '0', 'message': '3'}, 'extensions': []}]", 'result': [0, {}], 'block_num': 4, 'trx_in_block': 8, 'op_in_trx': 0, 'virtual_op': 5}

great problem with {'amount': '30100000000'}! Its return me integer. not float
real amount is 301.00000000

and this is not a big problem! big problem with btc! when real amount = 0.00555555
and it return me 555555

555555 btc? realy??

wtf?

why u cant make normal format data for returns? how i can make normal format to view all amount for all assets?

precision for btc = 8 symbols after dot

i have 6 symbols - 555555
seriously?

asset 1.3.5351 has precision 8. Hence you need to divide the integer amount by exp(10, 8)=10^8