Skip to content

Commit

Permalink
FE-478: Increase number of digits for rounding the results for the UI
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesdiedrich committed Mar 4, 2024
1 parent 687861d commit c72ba2c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gsy_framework/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ def get_area_uuid_name_mapping(area_dict, results):

def round_floats_for_ui(number):
"""Round the given number using the scale required by the UI."""
return round(number, 3)
return round(number, 5)


def round_prices_to_cents(number):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_bills.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def test_round_results_for_ui(self):
uuid_results["2345"]["pv"]["sold"] = 0.987
uuid_results["6789"]["earned"] = 12
results = self.bills._round_results_for_ui(uuid_results)
assert results["1234"]["house1"]["bought"] == 0.123
assert results["1234"]["house2"]["sold"] == 0.988
assert results["1234"]["house1"]["bought"] == 0.12346
assert results["1234"]["house2"]["sold"] == 0.98765
assert results["2345"]["pv"]["sold"] == 0.987
assert results["6789"]["earned"] == 12

0 comments on commit c72ba2c

Please sign in to comment.