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
-
amount
property -
currencyCode
property -
currencySymbol
property -
formattedAmount
property -
+ monetaryValueWithUSCents:
-
+ monetaryValueWithUSD:
-
– formattedAmountWithSymbol
-
– shortFormatWithSymbol
Properties
amount
The amount, in cents. So $1.00 would return 100.
@property (nonatomic, copy, readonly) NSNumber *amount
Discussion
The amount, in cents. So $1.00 would return 100.
Declared In
LUMonetaryValue.h
currencyCode
The currency code. Currently only “USD” is supported.
@property (nonatomic, copy, readonly) NSString *currencyCode
Discussion
The currency code. Currently only “USD” is supported.
Declared In
LUMonetaryValue.h
currencySymbol
The symbol used to represent the currency. Currently on ‘$’ (American Dollars) are supported.
@property (nonatomic, copy, readonly) NSString *currencySymbol
Discussion
The symbol used to represent the currency. Currently on ‘$’ (American Dollars) are supported.
Declared In
LUMonetaryValue.h
formattedAmount
Returns the amount formatted with a string (but no symbol). For example “1.23” represents 1 dollar and 23 cents.
@property (nonatomic, copy) NSString *formattedAmount
Discussion
Returns the amount formatted with a string (but no symbol). For example “1.23” represents 1 dollar and 23 cents.
Declared In
LUMonetaryValue.h
Class Methods
monetaryValueWithUSCents:
Returns an LUMonetaryValue
instance for the given amount, in cents.
+ (LUMonetaryValue *)monetaryValueWithUSCents:(NSNumber *)amount
Parameters
- amount
An amount of money, in cents.
Discussion
Returns an LUMonetaryValue
instance for the given amount, in cents.
Declared In
LUMonetaryValue.h
monetaryValueWithUSD:
Returns an LUMonetaryValue
instance for the given amount, in dollars.
+ (LUMonetaryValue *)monetaryValueWithUSD:(NSNumber *)amount
Parameters
- amount
An amount of money, in dollars.
Discussion
Returns an LUMonetaryValue
instance for the given amount, in dollars.
Declared In
LUMonetaryValue.h
Instance Methods
formattedAmountWithSymbol
Returns the the formatted amount preprended with the currency symbol. For example, “$1.23”.
- (NSString *)formattedAmountWithSymbol
Discussion
Returns the the formatted amount preprended with the currency symbol. For example, “$1.23”.
Declared In
LUMonetaryValue.h
shortFormatWithSymbol
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 *)shortFormatWithSymbol
Discussion
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