circuitpython/tests/extmod/json_loads_float.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
297 B
Python
Raw Permalink Normal View History

try:
import json
2017-02-14 17:56:22 -05:00
except ImportError:
print("SKIP")
raise SystemExit
def my_print(o):
print("%.3f" % o)
my_print(json.loads("1.2"))
my_print(json.loads("1e2"))
my_print(json.loads("-2.3"))
my_print(json.loads("-2e3"))
my_print(json.loads("-2e+3"))
my_print(json.loads("-2e-3"))