mirror of
https://github.com/Such-Software/xmrcheckout.git
synced 2026-12-01 12:14:11 +01:00
Add api
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
from decimal import Decimal
|
||||
|
||||
|
||||
def format_xmr_amount(value: Decimal) -> str:
|
||||
normalized = value.normalize()
|
||||
formatted = format(normalized, "f")
|
||||
if "." in formatted:
|
||||
formatted = formatted.rstrip("0").rstrip(".")
|
||||
return formatted or "0"
|
||||
Reference in New Issue
Block a user