You are here

function CurrencyInterface::formatAmount in Currency 8.3

Format an amount using this currency and the environment's default currency locale. pattern.

Parameters

string $amount: A numeric string.

boolean $use_currency_precision: Whether or not to use the precision (number of decimals) that the currency is configured to. If FALSE, the amount will be formatted as-is.

string $language_type: One of the \Drupal\Core\Language\LanguageInterface\TYPE_* constants.

Return value

string

1 method overrides CurrencyInterface::formatAmount()
Currency::formatAmount in src/Entity/Currency.php
Format an amount using this currency and the environment's default currency locale. pattern.

File

src/Entity/CurrencyInterface.php, line 28

Class

CurrencyInterface
Defines a currency.

Namespace

Drupal\currency\Entity

Code

function formatAmount($amount, $use_currency_precision = TRUE, $language_type = LanguageInterface::TYPE_CONTENT);