2

Possible Duplicate:
Format floats with standard json module

>>> import json
>>> foo={'bar': 0.2}
>>> json.dumps(foo, indent=4)
'{\n    "bar": 0.20000000000000001\n}'

Is there a way to have less precision/digits in the outputted JSON?

Community
  • 1
  • 1
user967722
  • 1,213
  • 1
  • 20
  • 26

0 Answers0