LUMonetaryValue Class Reference
| Inherits from | LUAPIModel : NSObject |
| Declared in | LUMonetaryValue.h LUMonetaryValue.m |
Overview
LUMonetaryValue is used to represent an amount of money in a specific currency. Currently, only
USD are supported.
Tasks
-
amountproperty -
currencyCodeproperty -
currencySymbolproperty -
formattedAmountproperty -
+ monetaryValueWithUSCents: -
+ monetaryValueWithUSD: -
– formattedAmountWithSymbol -
– shortFormatWithSymbol
Properties
amount
The amount, in cents. So $1.00 would return 100.
@property (nonatomic, copy, readonly) NSNumber *amountDiscussion
The amount, in cents. So $1.00 would return 100.
Declared In
LUMonetaryValue.hcurrencyCode
The currency code. Currently only “USD” is supported.
@property (nonatomic, copy, readonly) NSString *currencyCodeDiscussion
The currency code. Currently only “USD” is supported.
Declared In
LUMonetaryValue.hcurrencySymbol
The symbol used to represent the currency. Currently on ‘$’ (American Dollars) are supported.
@property (nonatomic, copy, readonly) NSString *currencySymbolDiscussion
The symbol used to represent the currency. Currently on ‘$’ (American Dollars) are supported.
Declared In
LUMonetaryValue.hformattedAmount
Returns the amount formatted with a string (but no symbol). For example “1.23” represents 1 dollar and 23 cents.
@property (nonatomic, copy) NSString *formattedAmountDiscussion
Returns the amount formatted with a string (but no symbol). For example “1.23” represents 1 dollar and 23 cents.
Declared In
LUMonetaryValue.hClass Methods
monetaryValueWithUSCents:
Returns an LUMonetaryValue instance for the given amount, in cents.
+ (LUMonetaryValue *)monetaryValueWithUSCents:(NSNumber *)amountParameters
- amount
An amount of money, in cents.
Discussion
Returns an LUMonetaryValue instance for the given amount, in cents.
Declared In
LUMonetaryValue.hmonetaryValueWithUSD:
Returns an LUMonetaryValue instance for the given amount, in dollars.
+ (LUMonetaryValue *)monetaryValueWithUSD:(NSNumber *)amountParameters
- amount
An amount of money, in dollars.
Discussion
Returns an LUMonetaryValue instance for the given amount, in dollars.
Declared In
LUMonetaryValue.hInstance Methods
formattedAmountWithSymbol
Returns the the formatted amount preprended with the currency symbol. For example, “$1.23”.
- (NSString *)formattedAmountWithSymbolDiscussion
Returns the the formatted amount preprended with the currency symbol. For example, “$1.23”.
Declared In
LUMonetaryValue.hshortFormatWithSymbol
Same as formattedAmountWithSymbol, with the exception that if the amount has only dollars and no
cents, the cents are dropped. For example, “$1” or “$1.23”.
- (NSString *)shortFormatWithSymbolDiscussion
Same as formattedAmountWithSymbol, with the exception that if the amount has only dollars and no
cents, the cents are dropped. For example, “$1” or “$1.23”.
Declared In
LUMonetaryValue.h