public function MinorUnitsConverterInterface::fromMinorUnits in Price 2.x
Same name and namespace in other branches
- 2.0.x src/MinorUnitsConverterInterface.php \Drupal\price\MinorUnitsConverterInterface::fromMinorUnits()
Converts an amount in "minor unit" to a decimal amount.
For example, 999 USD becomes 9.99.
Parameters
int|string $amount: The amount in minor unit.
string $currency_code: The currency code.
Return value
\Drupal\price\Price The decimal price.
1 method overrides MinorUnitsConverterInterface::fromMinorUnits()
- MinorUnitsConverter::fromMinorUnits in src/
MinorUnitsConverter.php - Converts an amount in "minor unit" to a decimal amount.
File
- src/
MinorUnitsConverterInterface.php, line 23
Class
- MinorUnitsConverterInterface
- Allows converting between Price objects (decimal) and minor units (integer).
Namespace
Drupal\priceCode
public function fromMinorUnits($amount, $currency_code) : Price;