Shopify SDK for Unity
Public Member Functions | List of all members
Shopify.Unity.MoneyV2 Class Reference

A monetary value with currency. More...

Inheritance diagram for Shopify.Unity.MoneyV2:
Shopify.Unity.SDK.AbstractResponse

Public Member Functions

 MoneyV2 (Dictionary< string, object > dataJSON)
 Accepts deserialized json data. Will further parse passed in data. More...
 
decimal amount ()
 Decimal money amount. More...
 
CurrencyCode currencyCode ()
 Currency of the money. More...
 
object Clone ()
 

Additional Inherited Members

- Protected Member Functions inherited from Shopify.Unity.SDK.AbstractResponse
Get< T > (string field, string alias=null)
 
- Protected Attributes inherited from Shopify.Unity.SDK.AbstractResponse
Dictionary< string, object > Data
 
- Properties inherited from Shopify.Unity.SDK.AbstractResponse
Dictionary< string, object > DataJSON [get, protected set]
 

Detailed Description

A monetary value with currency.

To format currencies, combine this type's amount and currencyCode fields with your client's locale.

For example, in JavaScript you could use Intl.NumberFormat:

new Intl.NumberFormat(locale, {
style: 'currency',
currency: currencyCode
}).format(amount);

Other formatting libraries include:

For a more general solution, the [Unicode CLDR number formatting database] is available with many implementations (such as TwitterCldr).

Constructor & Destructor Documentation

◆ MoneyV2()

Shopify.Unity.MoneyV2.MoneyV2 ( Dictionary< string, object >  dataJSON)
inline

Accepts deserialized json data. Will further parse passed in data.

Parameters
dataJSONDeserialized JSON data for MoneyV2

Member Function Documentation

◆ amount()

decimal Shopify.Unity.MoneyV2.amount ( )
inline

Decimal money amount.

◆ currencyCode()

CurrencyCode Shopify.Unity.MoneyV2.currencyCode ( )
inline

Currency of the money.


The documentation for this class was generated from the following file: