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

Membros públicos

 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)
 

Campos de Dados

 $formattingStyles
 
 $ISOCodeStyles
 
 $nonDollarSymbols
 
 $currenciesWithSymbolsAfterAmount
 

Descrição detalhada

Definido na linha 40 do ficheiro mcurrencyformatter.class.

Documentação das funções

◆ CurrencyFormatter()

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

Definido na linha 153 do ficheiro mcurrencyformatter.class.

◆ 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.

Definido na linha 167 do ficheiro mcurrencyformatter.class.

◆ 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

Definido na linha 465 do ficheiro mcurrencyformatter.class.

◆ 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.

Definido na linha 179 do ficheiro mcurrencyformatter.class.

◆ getFormattingStyles()

getFormattingStyles ( )

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

Retorna
array

Definido na linha 264 do ficheiro mcurrencyformatter.class.

◆ getISOCodes()

getISOCodes ( )

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

Retorna
array

Definido na linha 275 do ficheiro mcurrencyformatter.class.

◆ 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

Definido na linha 356 do ficheiro mcurrencyformatter.class.

◆ 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

Definido na linha 397 do ficheiro mcurrencyformatter.class.

◆ 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

Definido na linha 296 do ficheiro mcurrencyformatter.class.

◆ 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

Definido na linha 310 do ficheiro mcurrencyformatter.class.

◆ 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

Definido na linha 380 do ficheiro mcurrencyformatter.class.

◆ 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

Definido na linha 250 do ficheiro mcurrencyformatter.class.

◆ 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

Definido na linha 330 do ficheiro mcurrencyformatter.class.

◆ 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.

Definido na linha 216 do ficheiro mcurrencyformatter.class.

◆ 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

Definido na linha 233 do ficheiro mcurrencyformatter.class.

◆ 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.

Definido na linha 198 do ficheiro mcurrencyformatter.class.

◆ 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

Definido na linha 445 do ficheiro mcurrencyformatter.class.

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.

Definido na linha 143 do ficheiro mcurrencyformatter.class.

◆ $formattingStyles

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

A list of all the supported currency formatting styles.

Definido na linha 46 do ficheiro mcurrencyformatter.class.

◆ $ISOCodeStyles

$ISOCodeStyles

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

Definido na linha 61 do ficheiro mcurrencyformatter.class.

◆ $nonDollarSymbols

$nonDollarSymbols

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

Definido na linha 106 do ficheiro mcurrencyformatter.class.


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