You are here

function Currency::getRoundingStep in Currency 8.3

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

File

src/Entity/Currency.php, line 392

Class

Currency
Defines a currency entity class.

Namespace

Drupal\currency\Entity

Code

function getRoundingStep() {
  if (is_numeric($this->roundingStep)) {
    return $this->roundingStep;
  }
  elseif (is_numeric($this
    ->getSubunits())) {
    return $this
      ->getSubunits() > 0 ? bcdiv(1, $this
      ->getSubunits(), 6) : 1;
  }
  return NULL;
}