oanda / v20-python

OANDA v20 bindings for Python
MIT License
225 stars 91 forks source link

Floats and integers are returned as strings #26

Open FutureSharks opened 7 years ago

FutureSharks commented 7 years ago

I think it's a bit silly that numbers like floats and integers are returned as strings:

>>> import v20
>>> api = v20.Context(hostname='api-fxpractice.oanda.com', token='xxx', datetime_format='UNIX')
>>> api.pricing.get(accountID='101-xxxx', instruments='GBP_USD').get('prices')[0].dict()['bids'][0]['price']
'1.28662'
>>> api.pricing.get(accountID='101-xxxx', instruments='GBP_USD').get('prices')[0].dict()['time']
'1503089998.464826588'
>>>

Is there a reason for that?