billing: Create cents_to_dollar_string helper function.

This commit is contained in:
Vishnu KS
2020-10-20 19:16:04 +05:30
committed by Tim Abbott
parent 876af17dd8
commit 203ddfc546
2 changed files with 6 additions and 1 deletions

View File

@@ -190,6 +190,10 @@ def get_idempotency_key(ledger_entry: LicenseLedger) -> Optional[str]:
return f"ledger_entry:{ledger_entry.id}" # nocoverage
def cents_to_dollar_string(cents: int) -> str:
return f"{cents / 100.:,.2f}"
class BillingError(Exception):
# error messages
CONTACT_SUPPORT = gettext_lazy("Something went wrong. Please contact {email}.")