SQRDMoney
@interface SQRDMoney : NSObject <NSCopying>
Represents an amount of money.
-
Create a new
SQRDMoneyinstance.The currency is set automatically based on the currency of the authorized location at the time of checkout.
Declaration
Objective-C
- (nonnull instancetype)initWithAmount:(NSInteger)amount;Swift
init(amount: Int)Parameters
amountThe monetary amount, specified as a non-negative integer in the smallest currency denomination of the authorized location. For example, when the location’s currency is USD, the amount is in cents.
-
Create a new
SQRDMoneyinstance.Declaration
Objective-C
- (nonnull instancetype)initWithAmount:(NSInteger)amount currencyCode:(SQRDCurrencyCode)currencyCode;Swift
init(amount: Int, currencyCode: SQRDCurrencyCode)Parameters
amountThe monetary amount, specified as a non-negative integer in the smallest currency denomination of the authorized location. For example, when the
currencyCodeis.usd, the amount is in cents.currencyCodeThe currency code (for example, the currency code for the US Dollar is
.usd). -
The amount of money in the smallest denomination of the currency.
For example, when
currencyCodeis.usd, the amount is in cents.Declaration
Objective-C
@property (readonly, nonatomic) NSInteger amount;Swift
var amount: Int { get } -
The currency code.
Declaration
Objective-C
@property (readonly, nonatomic) SQRDCurrencyCode currencyCode;Swift
var currencyCode: SQRDCurrencyCode { get }
SQRDMoney Class Reference