Zend\I18n\View\Helper\CurrencyFormat
View helper for formatting currency.
Synopsis
class CurrencyFormat
extends AbstractHelper
{
- // members
- protected string $currencyCode;
- protected array $formatters;
- protected string $locale;
- protected string $currencyPattern;
- protected bool $showDecimals;
- // Inherited members from AbstractHelper
- protected RendererInterface $view;
- // methods
- public void __construct()
- public string __invoke()
- protected string formatCurrency()
- public CurrencyFormat setCurrencyCode()
- public string getCurrencyCode()
- public CurrencyFormat setCurrencyPattern()
- public string getCurrencyPattern()
- public CurrencyFormat setLocale()
- public string|null getLocale()
- public CurrencyFormat setShouldShowDecimals()
- public bool shouldShowDecimals()
- // Inherited methods from AbstractHelper
- public AbstractHelper setView()
- public null|Renderer getView()
Hierarchy
Extends
Members
protected
- $currencyCode
—
string
The 3-letter ISO 4217 currency code indicating the currency to use - $currencyPattern
—
string
Currency pattern - $formatters
—
array
Formatter instances - $locale
—
string
Locale to use instead of the default - $showDecimals
—
Zend\I18n\View\Helper\bool
If set to true, the currency will be returned with two decimals - $view
—
Zend\View\Renderer\RendererInterface
View object instance
Methods
protected
- formatCurrency() — Format a number
public
- __construct()
- __invoke() — Format a number
- getCurrencyCode() — Get the 3-letter ISO 4217 currency code indicating the currency to use
- getCurrencyPattern() — Get the currency pattern
- getLocale() — Get the locale to use
- setCurrencyCode() — The 3-letter ISO 4217 currency code indicating the currency to use
- setCurrencyPattern() — Set the currency pattern
- setLocale() — Set locale to use instead of the default
- setShouldShowDecimals() — Set if the view helper should show two decimals
- shouldShowDecimals() — Get if the view helper should show two decimals