Skip to content

Commit

Permalink
Merge pull request #83 from ImMin5/master
Browse files Browse the repository at this point in the history
ix divided by zero error for calculating exchange rates
  • Loading branch information
ImMin5 authored Aug 4, 2024
2 parents d366a3f + 9c83a7a commit b00f8dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cloudforet/cost_analysis/manager/cost_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ def _get_saved_cost(self, result: dict, cost: float) -> float:

unit_price = self.retail_price_map[f"{meter_id}:{product_id}"]

if currency != "USD":
if currency != "USD" and quantity > 0:
cost_in_billing_currency = self._convert_str_to_float_format(
result.get("costinbillingcurrency", 0.0)
)
Expand Down

0 comments on commit b00f8dd

Please sign in to comment.