function Currency::getDecimals in Currency 7.2
Returns the number of decimals.
Return value
int
File
- currency/
vendor/ bartfeenstra/ currency/ src/ BartFeenstra/ Currency/ Currency.php, line 171 - Contains class \BartFeenstra\Currency\Currency.
Class
- Currency
- Describes a currency.
Namespace
BartFeenstra\CurrencyCode
function getDecimals() {
$decimals = 0;
if ($this->subunits > 0) {
$decimals = 1;
while (pow(10, $decimals) < $this->subunits) {
$decimals++;
}
}
return $decimals;
}