Skip to content

Commit

Permalink
Update data/common/__init__.py
Browse files Browse the repository at this point in the history
Co-authored-by: Vincent Jousse <[email protected]>
  • Loading branch information
paulboosz and vjousse authored Dec 19, 2024
1 parent d299ed2 commit 78b9bc1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion data/common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ class FormatNumberJsonEncoder(json.JSONEncoder):
def encode(self, obj):
def recursive_format_number(obj):
if isinstance(obj, (int, float)):
return format_number(obj)
return float(f"{obj:.6g}")
elif isinstance(obj, dict):
return {k: recursive_format_number(v) for k, v in obj.items()}
elif isinstance(obj, list):
Expand Down

0 comments on commit 78b9bc1

Please sign in to comment.