public function CurrencyRepositoryInterface::getDefaultFractionDigits in Price 2.0.x
Same name and namespace in other branches
- 2.x src/Repository/CurrencyRepositoryInterface.php \Drupal\price\Repository\CurrencyRepositoryInterface::getDefaultFractionDigits()
Gets the default number of fraction digits for the given currency code.
Merchants are allowed to override the fraction digits through the UI, which can have an unexpected effect on payment gateways, which use that information when converting amounts to minor units.
Parameters
string $currency_code: The currency code.
Return value
int The number of fraction digits.
Throws
\CommerceGuys\Intl\Exception\UnknownCurrencyException Thrown if the given currency code is unknown.
1 method overrides CurrencyRepositoryInterface::getDefaultFractionDigits()
- CurrencyRepository::getDefaultFractionDigits in src/
Repository/ CurrencyRepository.php - Gets the default number of fraction digits for the given currency code.
File
- src/
Repository/ CurrencyRepositoryInterface.php, line 28
Class
- CurrencyRepositoryInterface
- Defines the currency repository interface.
Namespace
Drupal\price\RepositoryCode
public function getDefaultFractionDigits(string $currency_code) : int;