MIOLO26
Carregando...
Procurando...
Nenhuma entrada encontrada
Referência à classe CurrencyFormatter
Diagrama de heranças da classe CurrencyFormatter
MCurrencyFormatter

Membros públicos

 CurrencyFormatter ()
 
 __construct ()
 
 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)
 

Campos de Dados

 $formattingStyles
 
 $ISOCodeStyles
 
 $nonDollarSymbols
 
 $currenciesWithSymbolsAfterAmount
 

Documentação dos Construtores & Destrutor

◆ __construct()

__construct ( )

Documentação das funções

◆ CurrencyFormatter()

Sets up the instance variables. Must be called for the object to operate correctly. @access public

◆ format()

format ( $amount,
$ISOCode )

Returns the specified amount formatted according to the formatting style used for the specified ISO 4217 currency code.

@access public

Parâmetros
double$amountThe amount to be formatted.
string$ISOCodeISO 4217 currency code.
Retorna
string The formatted amount.

Reimplementado em MCurrencyFormatter.

◆ formatWithStyle()

formatWithStyle ( $amount,
$style )

Returns the specified amount formatted according to the specified formatting style.

@access public

Parâmetros
double$amountThe amount to be formatted.
string$styleThe style to be used for formatting.
Retorna
string

◆ formatWithSymbol()

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.

Reimplementado em MCurrencyFormatter.

◆ getFormattingStyles()

getFormattingStyles ( )

Returns an hashtable of the supported formatting styles. @access public

Retorna
array

◆ getISOCodes()

getISOCodes ( )

Returns an array of the supported ISO 4217 codes. @access public

Retorna
array

◆ getPrefixSuffixArray()

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"*

@access public

Parâmetros
string$ISOCodeISO 4217 currency code.
Retorna
array

◆ getSeparators()

getSeparators ( $style)

Returns a two element array that contains the thousands separator and the the decimal place separator respectively for the specified formatting style.

@access private

Parâmetros
string$styleThe formatting style to be used.
Retorna
array

◆ getStyleForISOCode()

getStyleForISOCode ( $ISOCode)

Returns the key of the formatting style used for the specified ISO 4217 currency code.

@access public

Parâmetros
string$ISOCodeISO 4217 currency code.
Retorna
string

◆ getSymbol()

getSymbol ( $ISOCode)

Returns the symbol (ie. '$' or 'Y') for the specified ISO 4217 currency code.

@access public

Parâmetros
string$ISOCodeISO 4217 currency code.
Retorna
string

◆ removePrefixAndSuffix()

removePrefixAndSuffix ( $amount,
$ISOCode )

Removes the prefix and suffix from an $amount formatted for the specified $ISOCode. @access public

Parâmetros
double$amount
string$ISOCode
Retorna
string

◆ supportsISOCode()

supportsISOCode ( $ISOCode)

Checks to see if the formatting for the specified code is supported.

Parâmetros
string$ISOCodeISO 4217 currency code. @access public
Retorna
boolean

◆ symbolIsAfterAmount()

symbolIsAfterAmount ( $ISOCode)

Returns true if the symbol for the specified ISO 4217 currency code should be displayed after (to the right of) the amount.

@access public

Parâmetros
string$ISOCodeISO 4217 currency code.
Retorna
boolean

◆ toDecimal()

toDecimal ( $amount,
$ISOCode )

Returns the decimal amount represented by the amount according to the formatting style used for the specified ISO 4217 currency code.

@access public

Parâmetros
double$amountThe amount to be validated.
string$ISOCodeISO 4217 currency code.
Retorna
double

Reimplementado em MCurrencyFormatter.

◆ toDecimalForStyle()

toDecimalForStyle ( $amount,
$style )

Returns the decimal amount represented by the amount according to the specified formatting style.

@access public

Parâmetros
double$amountThe amount to be validated.
string$styleThe formatting style to be used.
Retorna
double

◆ validate()

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.

@access public

Parâmetros
double$amountThe amount to be validated.
string$ISOCodeISO 4217 currency code.
Retorna
boolean True if $amount is properly formatted, false if not.

Reimplementado em MCurrencyFormatter.

◆ validateForStyle()

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.

@access public

Parâmetros
double$amountThe amount to be validated.
string$styleThe formatting style to validate.
Retorna
boolean

Documentação dos campos e atributos

◆ $currenciesWithSymbolsAfterAmount

$currenciesWithSymbolsAfterAmount
Valor inicial:
= array(
"DKR", "FIM", "FRF", "DEM", "GRD", "ISK", "ITL", "LTL",
"NOK", "ESP", "SEK", "THB", "CZK", "LUF", "PLZ", "PTE",
"TRL"
)

A list of the ISO 4217 currency codes that have their symbol displayed after the amount.

◆ $formattingStyles

$formattingStyles
Valor inicial:
= array(
"standard",
"noDecimals",
"dotThousandsCommaDecimal",
"apostropheThousandsDotDecimal",
"apostropheThousandsNoDecimals",
"spaceThousandsDotDecimal",
"spaceThousandsCommaDecimal",
"indian"
)

A list of all the supported currency formatting styles.

◆ $ISOCodeStyles

$ISOCodeStyles

A hashtable that maps the supported ISO 4217 currency codes to the formatting style to be used for amounts in that currency.

◆ $nonDollarSymbols

$nonDollarSymbols

A list of all the supported ISO 4217 currency codes that don't have a dollar sign as their symbol.


A documentação para esta classe foi gerada a partir do seguinte ficheiro: