CurrencyFormatter
in package
Currency formatter
Tags
Table of Contents
- $defaultCurrency : string
- Default currency format (ISO 4217) to use.
- $formatter : NumberFormatter
- Number formatter.
- __construct() : mixed
- Constructor
- convertToDisplayFormat() : string
- Convert currency from float to display format
Properties
$defaultCurrency
Default currency format (ISO 4217) to use.
protected
string
$defaultCurrency
$formatter
Number formatter.
protected
NumberFormatter
$formatter
Methods
__construct()
Constructor
public
__construct([string $defaultCurrency = null ][, string $locale = null ]) : mixed
Parameters
- $defaultCurrency : string = null
-
Default currency format (ISO 4217) to use (null for default from system locale)
- $locale : string = null
-
Locale to use for number formatting (null for default system locale)
Return values
mixed —convertToDisplayFormat()
Convert currency from float to display format
public
convertToDisplayFormat(float $number[, string $currency = null ]) : string
Parameters
- $number : float
-
The number to format
- $currency : string = null
-
Currency format (ISO 4217) to use (null for default)