Damien George
10 years ago
5 changed files with 21 additions and 10 deletions
@ -0,0 +1,6 @@ |
|||
try: |
|||
import ujson as json |
|||
except ImportError: |
|||
import json |
|||
|
|||
print(json.dumps(1.2)) |
@ -0,0 +1,13 @@ |
|||
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')) |
Loading…
Reference in new issue