Here is a response I am getting from server
[{"type":"bid","price":0.00000026,"amount":737.15054457,"tid":200001915,"timestamp":1516036570}]
I am trying to parse this string into JSON using
json_data = json.loads (req.text)
However when I try to read the 'price' using json_data[0]['price'] the output is 2.6e-07
I tried parsing data as json_data = json.loads (req.text, parse_float=Decimal) but still no difference.
This is the way python shows floats
price = 0.00000026
print(price)
outputs: 2.6e-07 you can print it this way if you want to see it normal:
print('{0:.8f}'.format(price))
ouputs: 0.00000026
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With