MoneyV2 对象
带有货币的货币价值。
要设置货币格式,请将此类型的数量和currencyCode字段与客户的区域设置结合使用。
例如,在JavaScript中,您可以使用Intl.NumberFormat:
new Intl.NumberFormat(locale, {style: 'currency',currency: currencyCode}).format(amount);
其他格式库包括:
- iOS- NumberFormatter
- Android- NumberFormat
- PHP- NumberFormatter
对于更通用的解决方案,[Unicode CLDR数字格式数据库]可用于许多实现(例如TwitterCldr)。
在本页面
字段
- amount(
[Decimal!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#decimal-2021-01))
小数金额。 - currencyCode(
[CurrencyCode!](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/currencycode))
货币货币。
返回MoneyV2的类型
[AppCredit.amount](https://shopify.dev/docs/admin-api/graphql/reference/billing/appcredit#amount-2021-01)[AppPurchaseOneTime.price](https://shopify.dev/docs/admin-api/graphql/reference/billing/apppurchaseonetime#price-2021-01)[AppRecurringPricing.price](https://shopify.dev/docs/admin-api/graphql/reference/billing/apprecurringpricing#price-2021-01)[AppUsagePricing.balanceUsed](https://shopify.dev/docs/admin-api/graphql/reference/billing/appusagepricing#balanceused-2021-01)[AppUsagePricing.cappedAmount](https://shopify.dev/docs/admin-api/graphql/reference/billing/appusagepricing#cappedamount-2021-01)[AppUsageRecord.price](https://shopify.dev/docs/admin-api/graphql/reference/billing/appusagerecord#price-2021-01)[CalculatedDraftOrderLineItem.discountedTotal](https://shopify.dev/docs/admin-api/graphql/reference/orders/calculateddraftorderlineitem#discountedtotal-2021-01)[CalculatedDraftOrderLineItem.discountedUnitPrice](https://shopify.dev/docs/admin-api/graphql/reference/orders/calculateddraftorderlineitem#discountedunitprice-2021-01)[CalculatedDraftOrderLineItem.originalTotal](https://shopify.dev/docs/admin-api/graphql/reference/orders/calculateddraftorderlineitem#originaltotal-2021-01)[CalculatedDraftOrderLineItem.originalUnitPrice](https://shopify.dev/docs/admin-api/graphql/reference/orders/calculateddraftorderlineitem#originalunitprice-2021-01)[CalculatedDraftOrderLineItem.totalDiscount](https://shopify.dev/docs/admin-api/graphql/reference/orders/calculateddraftorderlineitem#totaldiscount-2021-01)[Customer.averageOrderAmountV2](https://shopify.dev/docs/admin-api/graphql/reference/customers/customer#averageorderamountv2-2021-01)[Customer.totalSpentV2](https://shopify.dev/docs/admin-api/graphql/reference/customers/customer#totalspentv2-2021-01)[DeliveryParticipant.fixedFee](https://shopify.dev/docs/admin-api/graphql/reference/shipping-and-fulfillment/deliveryparticipant#fixedfee-2021-01)[DeliveryRateDefinition.price](https://shopify.dev/docs/admin-api/graphql/reference/shipping-and-fulfillment/deliveryratedefinition#price-2021-01)[DiscountAmount.amount](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/discountamount#amount-2021-01)[DiscountCodeBasic.totalSales](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/discountcodebasic#totalsales-2021-01)[DiscountCodeBxgy.totalSales](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/discountcodebxgy#totalsales-2021-01)[DiscountCodeFreeShipping.maximumShippingPrice](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/discountcodefreeshipping#maximumshippingprice-2021-01)[DiscountCodeFreeShipping.totalSales](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/discountcodefreeshipping#totalsales-2021-01)[DiscountMinimumSubtotal.greaterThanOrEqualToSubtotal](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/discountminimumsubtotal#greaterthanorequaltosubtotal-2021-01)[DraftOrderAppliedDiscount.amountV2](https://shopify.dev/docs/admin-api/graphql/reference/orders/draftorderapplieddiscount#amountv2-2021-01)[InventoryItem.unitCost](https://shopify.dev/docs/admin-api/graphql/reference/inventory/inventoryitem#unitcost-2021-01)[MarketingActivity.adSpend](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/marketingactivity#adspend-2021-01)[MarketingBudget.total](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/marketingbudget#total-2021-01)[MarketingEngagement.adSpend](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/marketingengagement#adspend-2021-01)[MoneyBag.presentmentMoney](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/moneybag#presentmentmoney-2021-01)[MoneyBag.shopMoney](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/moneybag#shopmoney-2021-01)[OrderStagedChangeAddCustomItem.originalUnitPrice](https://shopify.dev/docs/admin-api/graphql/reference/orders/orderstagedchangeaddcustomitem#originalunitprice-2021-01)[OrderStagedChangeAddShippingLine.price](https://shopify.dev/docs/admin-api/graphql/reference/orders/orderstagedchangeaddshippingline#price-2021-01)[OrderTransaction.maximumRefundableV2](https://shopify.dev/docs/admin-api/graphql/reference/orders/ordertransaction#maximumrefundablev2-2021-01)[PriceRule.totalSales](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/pricerule#totalsales-2021-01)[ProductPriceRange.maxVariantPrice](https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/productpricerange#maxvariantprice-2021-01)[ProductPriceRange.minVariantPrice](https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/productpricerange#minvariantprice-2021-01)[ProductPriceRangeV2.maxVariantPrice](https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/productpricerangev2#maxvariantprice-2021-01)[ProductPriceRangeV2.minVariantPrice](https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/productpricerangev2#minvariantprice-2021-01)[ProductVariantPricePair.price](https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/productvariantpricepair#price-2021-01)[ProductVariantPricePair.compareAtPrice](https://shopify.dev/docs/admin-api/graphql/reference/products-and-collections/productvariantpricepair#compareatprice-2021-01)[ShippingRate.price](https://shopify.dev/docs/admin-api/graphql/reference/shipping-and-fulfillment/shippingrate#price-2021-01)[ShopifyPaymentsAccount.balance](https://shopify.dev/docs/admin-api/graphql/reference/shopify-payments/shopifypaymentsaccount#balance-2021-01)[ShopifyPaymentsDispute.amount](https://shopify.dev/docs/admin-api/graphql/reference/shopify-payments/shopifypaymentsdispute#amount-2021-01)[ShopifyPaymentsPayout.net](https://shopify.dev/docs/admin-api/graphql/reference/shopify-payments/shopifypaymentspayout#net-2021-01)[ShopifyPaymentsPayoutSummary.retriedPayoutsFee](https://shopify.dev/docs/admin-api/graphql/reference/shopify-payments/shopifypaymentspayoutsummary#retriedpayoutsfee-2021-01)[ShopifyPaymentsPayoutSummary.retriedPayoutsGross](https://shopify.dev/docs/admin-api/graphql/reference/shopify-payments/shopifypaymentspayoutsummary#retriedpayoutsgross-2021-01)[ShopifyPaymentsPayoutSummary.reservedFundsGross](https://shopify.dev/docs/admin-api/graphql/reference/shopify-payments/shopifypaymentspayoutsummary#reservedfundsgross-2021-01)[ShopifyPaymentsPayoutSummary.adjustmentsFee](https://shopify.dev/docs/admin-api/graphql/reference/shopify-payments/shopifypaymentspayoutsummary#adjustmentsfee-2021-01)[ShopifyPaymentsPayoutSummary.adjustmentsGross](https://shopify.dev/docs/admin-api/graphql/reference/shopify-payments/shopifypaymentspayoutsummary#adjustmentsgross-2021-01)[ShopifyPaymentsPayoutSummary.chargesFee](https://shopify.dev/docs/admin-api/graphql/reference/shopify-payments/shopifypaymentspayoutsummary#chargesfee-2021-01)[ShopifyPaymentsPayoutSummary.chargesGross](https://shopify.dev/docs/admin-api/graphql/reference/shopify-payments/shopifypaymentspayoutsummary#chargesgross-2021-01)[ShopifyPaymentsPayoutSummary.refundsFee](https://shopify.dev/docs/admin-api/graphql/reference/shopify-payments/shopifypaymentspayoutsummary#refundsfee-2021-01)[ShopifyPaymentsPayoutSummary.refundsFeeGross](https://shopify.dev/docs/admin-api/graphql/reference/shopify-payments/shopifypaymentspayoutsummary#refundsfeegross-2021-01)[ShopifyPaymentsPayoutSummary.reservedFundsFee](https://shopify.dev/docs/admin-api/graphql/reference/shopify-payments/shopifypaymentspayoutsummary#reservedfundsfee-2021-01)[SubscriptionContract.deliveryPrice](https://shopify.dev/docs/admin-api/graphql/reference/orders/subscriptioncontract#deliveryprice-2021-01)[SubscriptionCyclePriceAdjustment.computedPrice](https://shopify.dev/docs/admin-api/graphql/reference/orders/subscriptioncyclepriceadjustment#computedprice-2021-01)[SubscriptionDiscountAllocation.amount](https://shopify.dev/docs/admin-api/graphql/reference/orders/subscriptiondiscountallocation#amount-2021-01)[SubscriptionDiscountFixedAmountValue.amount](https://shopify.dev/docs/admin-api/graphql/reference/orders/subscriptiondiscountfixedamountvalue#amount-2021-01)[SubscriptionDraft.deliveryPrice](https://shopify.dev/docs/admin-api/graphql/reference/orders/subscriptiondraft#deliveryprice-2021-01)[SubscriptionLine.lineDiscountedPrice](https://shopify.dev/docs/admin-api/graphql/reference/orders/subscriptionline#linediscountedprice-2021-01)[SubscriptionLine.currentPrice](https://shopify.dev/docs/admin-api/graphql/reference/orders/subscriptionline#currentprice-2021-01)[SubscriptionPricingPolicy.basePrice](https://shopify.dev/docs/admin-api/graphql/reference/orders/subscriptionpricingpolicy#baseprice-2021-01)[SubscriptionShippingOption.price](https://shopify.dev/docs/admin-api/graphql/reference/orders/subscriptionshippingoption#price-2021-01)[TenderTransaction.amount](https://shopify.dev/docs/admin-api/graphql/reference/orders/tendertransaction#amount-2021-01)[TransactionFee.amount](https://shopify.dev/docs/admin-api/graphql/reference/orders/transactionfee#amount-2021-01)[TransactionFee.flatFee](https://shopify.dev/docs/admin-api/graphql/reference/orders/transactionfee#flatfee-2021-01)[TransactionFee.taxAmount](https://shopify.dev/docs/admin-api/graphql/reference/orders/transactionfee#taxamount-2021-01)
