
Public Member Functions | |
| CurrencyFormatter () | |
| format ($amount, $ISOCode) | |
| formatWithSymbol ($amount, $ISOCode) | |
| validate ($amount, $ISOCode) | |
| toDecimal ($amount, $ISOCode) | |
| toDecimalForStyle ($amount, $style) | |
| supportsISOCode ($ISOCode) | |
| getFormattingStyles () | |
| getISOCodes () | |
| getStyleForISOCode ($ISOCode) | |
| getSymbol ($ISOCode) | |
| symbolIsAfterAmount ($ISOCode) | |
| getPrefixSuffixArray ($ISOCode) | |
| removePrefixAndSuffix ($amount, $ISOCode) | |
| getSeparators ($style) | |
| validateForStyle ($amount, $style) | |
| formatWithStyle ($amount, $style) | |
Public Attributes | |
| $formattingStyles | |
| $ISOCodeStyles | |
| $nonDollarSymbols | |
| $currenciesWithSymbolsAfterAmount | |
Definition at line 40 of file mcurrencyformatter.class.
| CurrencyFormatter::CurrencyFormatter | ( | ) |
Sets up the instance variables. Must be called for the object to operate correctly. public
Definition at line 153 of file mcurrencyformatter.class.
| CurrencyFormatter::format | ( | $ | amount, | |
| $ | ISOCode | |||
| ) |
Returns the specified amount formatted according to the formatting style used for the specified ISO 4217 currency code.
public
| double | $amount The amount to be formatted. | |
| string | $ISOCode ISO 4217 currency code. |
Reimplemented in MCurrencyFormatter.
Definition at line 167 of file mcurrencyformatter.class.
References formatWithStyle(), and getStyleForISOCode().
Referenced by formatWithSymbol().
Here is the call graph for this function:

Here is the caller graph for this function:

| CurrencyFormatter::formatWithSymbol | ( | $ | amount, | |
| $ | ISOCode | |||
| ) |
Returns the specified amount formatted according to the formatting style used for the specified ISO 4217 currency code with the currency symbol included.
Reimplemented in MCurrencyFormatter.
Definition at line 179 of file mcurrencyformatter.class.
References format(), and getPrefixSuffixArray().
Here is the call graph for this function:

| CurrencyFormatter::validate | ( | $ | amount, | |
| $ | ISOCode | |||
| ) |
Validates whether the specified amount is properly formatted according to the formatting style used for the specified ISO 4217 currency code. Returns true if the specified amount is properly formatted.
public
| double | $amount The amount to be validated. | |
| string | $ISOCode ISO 4217 currency code. |
Reimplemented in MCurrencyFormatter.
Definition at line 198 of file mcurrencyformatter.class.
References getStyleForISOCode(), removePrefixAndSuffix(), and validateForStyle().
Here is the call graph for this function:

| CurrencyFormatter::toDecimal | ( | $ | amount, | |
| $ | ISOCode | |||
| ) |
Returns the decimal amount represented by the amount according to the formatting style used for the specified ISO 4217 currency code.
public
| double | $amount The amount to be validated. | |
| string | $ISOCode ISO 4217 currency code. |
Reimplemented in MCurrencyFormatter.
Definition at line 216 of file mcurrencyformatter.class.
References getStyleForISOCode(), removePrefixAndSuffix(), and toDecimalForStyle().
Here is the call graph for this function:

| CurrencyFormatter::toDecimalForStyle | ( | $ | amount, | |
| $ | style | |||
| ) |
Returns the decimal amount represented by the amount according to the specified formatting style.
public
| double | $amount The amount to be validated. | |
| string | $style The formatting style to be used. |
Definition at line 233 of file mcurrencyformatter.class.
References getSeparators().
Referenced by toDecimal().
Here is the call graph for this function:

Here is the caller graph for this function:

| CurrencyFormatter::supportsISOCode | ( | $ | ISOCode | ) |
Checks to see if the formatting for the specified code is supported.
| string | $ISOCode ISO 4217 currency code. public |
Definition at line 250 of file mcurrencyformatter.class.
| CurrencyFormatter::getFormattingStyles | ( | ) |
Returns an hashtable of the supported formatting styles. public
Definition at line 264 of file mcurrencyformatter.class.
| CurrencyFormatter::getISOCodes | ( | ) |
Returns an array of the supported ISO 4217 codes. public
Definition at line 275 of file mcurrencyformatter.class.
| CurrencyFormatter::getStyleForISOCode | ( | $ | ISOCode | ) |
Returns the key of the formatting style used for the specified ISO 4217 currency code.
public
| string | $ISOCode ISO 4217 currency code. |
Definition at line 296 of file mcurrencyformatter.class.
Referenced by format(), toDecimal(), and validate().
Here is the caller graph for this function:

| CurrencyFormatter::getSymbol | ( | $ | ISOCode | ) |
Returns the symbol (ie. '$' or 'Y') for the specified ISO 4217 currency code.
public
| string | $ISOCode ISO 4217 currency code. |
Definition at line 310 of file mcurrencyformatter.class.
Referenced by getPrefixSuffixArray().
Here is the caller graph for this function:

| CurrencyFormatter::symbolIsAfterAmount | ( | $ | ISOCode | ) |
Returns true if the symbol for the specified ISO 4217 currency code should be displayed after (to the right of) the amount.
public
| string | $ISOCode ISO 4217 currency code. |
Definition at line 330 of file mcurrencyformatter.class.
Referenced by getPrefixSuffixArray().
Here is the caller graph for this function:

| CurrencyFormatter::getPrefixSuffixArray | ( | $ | ISOCode | ) |
Convenience function that returns an array with two elements: a prefix and a suffix. eg. list($prefix, $suffix) = $cf->getPrefixSuffixArray( "AUD" ); echo $prefix.$cf->format( 9999.95, "AUD" ).$suffix; // outputs "$9,999.95"*
public
| string | $ISOCode ISO 4217 currency code. |
Definition at line 356 of file mcurrencyformatter.class.
References getSymbol(), and symbolIsAfterAmount().
Referenced by formatWithSymbol(), and removePrefixAndSuffix().
Here is the call graph for this function:

Here is the caller graph for this function:

| CurrencyFormatter::removePrefixAndSuffix | ( | $ | amount, | |
| $ | ISOCode | |||
| ) |
Removes the prefix and suffix from an $amount formatted for the specified $ISOCode. public
| double | $amount | |
| string | $ISOCode |
Definition at line 380 of file mcurrencyformatter.class.
References getPrefixSuffixArray().
Referenced by toDecimal(), and validate().
Here is the call graph for this function:

Here is the caller graph for this function:

| CurrencyFormatter::getSeparators | ( | $ | style | ) |
Returns a two element array that contains the thousands separator and the the decimal place separator respectively for the specified formatting style.
private
| string | $style The formatting style to be used. |
Definition at line 397 of file mcurrencyformatter.class.
Referenced by toDecimalForStyle(), and validateForStyle().
Here is the caller graph for this function:

| CurrencyFormatter::validateForStyle | ( | $ | amount, | |
| $ | style | |||
| ) |
Validates whether the specified amount is properly formatted according to the specified formatting style. Returns true if the specified amount is properly formatted.
public
| double | $amount The amount to be validated. | |
| string | $style The formatting style to validate. |
Definition at line 445 of file mcurrencyformatter.class.
References getSeparators().
Referenced by validate().
Here is the call graph for this function:

Here is the caller graph for this function:

| CurrencyFormatter::formatWithStyle | ( | $ | amount, | |
| $ | style | |||
| ) |
Returns the specified amount formatted according to the specified formatting style.
public
| double | $amount The amount to be formatted. | |
| string | $style The style to be used for formatting. |
Definition at line 465 of file mcurrencyformatter.class.
Referenced by format().
Here is the caller graph for this function:

| CurrencyFormatter::$formattingStyles |
Initial value:
array(
"standard",
"noDecimals",
"dotThousandsCommaDecimal",
"apostropheThousandsDotDecimal",
"apostropheThousandsNoDecimals",
"spaceThousandsDotDecimal",
"spaceThousandsCommaDecimal",
"indian"
)
Definition at line 46 of file mcurrencyformatter.class.
| CurrencyFormatter::$ISOCodeStyles |
A hashtable that maps the supported ISO 4217 currency codes to the formatting style to be used for amounts in that currency.
Definition at line 61 of file mcurrencyformatter.class.
| CurrencyFormatter::$nonDollarSymbols |
A list of all the supported ISO 4217 currency codes that don't have a dollar sign as their symbol.
Definition at line 106 of file mcurrencyformatter.class.
| CurrencyFormatter::$currenciesWithSymbolsAfterAmount |
Initial value:
array(
"DKR", "FIM", "FRF", "DEM", "GRD", "ISK", "ITL", "LTL",
"NOK", "ESP", "SEK", "THB", "CZK", "LUF", "PLZ", "PTE",
"TRL"
)
Definition at line 143 of file mcurrencyformatter.class.