fine printing for floats in the roi tables (round to 5 digits after the decimal point)

This commit is contained in:
hroff-1902
2019-08-20 22:17:21 +03:00
parent 5b9711c002
commit a12876da92
3 changed files with 14 additions and 4 deletions

View File

@@ -113,3 +113,10 @@ def deep_merge_dicts(source, destination):
destination[key] = value
return destination
def round_dict(d, n):
"""
Rounds float values in the dict to n digits after the decimal point.
"""
return {k: (round(v, n) if isinstance(v, float) else v) for k, v in d.items()}