Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Return amount as quantize_price from Money type
IKarbowiak593623b716f7
diff --git a/saleor/graphql/core/types/money.py b/saleor/graphql/core/types/money.pyindex 0cbf0c91a8..ed70b40529 100644--- a/saleor/graphql/core/types/money.py+++ b/saleor/graphql/core/types/money.py@@ -1,6 +1,7 @@import graphenefrom django_prices.templatetags import prices+from ....core.prices import quantize_pricefrom ..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)+@staticmethoddef resolve_localized(root, _info):return prices.amount(root)