Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Return amount as quantize_price from Money type

IKarbowiak593623b716f7
diff --git a/saleor/graphql/core/types/money.py b/saleor/graphql/core/types/money.py
index 0cbf0c91a8..ed70b40529 100644
--- a/saleor/graphql/core/types/money.py
+++ b/saleor/graphql/core/types/money.py
@@ -1,6 +1,7 @@
import graphene
from django_prices.templatetags import prices
+from ....core.prices import quantize_price
from ..enums import TaxRateType
@@ -19,6 +20,10 @@ class Money(graphene.ObjectType):
class Meta:
description = "Represents amount of money in specific currency."
+ @staticmethod
+ def resolve_amount(root, _info):
+ return quantize_price(root.amount, root.currency)
+
@staticmethod
def resolve_localized(root, _info):
return prices.amount(root)