mirror of
https://github.com/licsber/micropython.git
synced 2024-09-21 01:20:23 +08:00
14 lines
239 B
Python
14 lines
239 B
Python
|
try:
|
||
|
import ujson as json
|
||
|
except:
|
||
|
import json
|
||
|
|
||
|
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'))
|