You are here

public function MinorUnitsConverterInterface::toMinorUnits in Price 2.x

Same name and namespace in other branches
  1. 2.0.x src/MinorUnitsConverterInterface.php \Drupal\price\MinorUnitsConverterInterface::toMinorUnits()

Converts the given amount to its minor units.

For example, 9.99 USD becomes 999.

Parameters

\Drupal\price\Price $amount: The amount.

Return value

int The amount in minor units, as an integer.

1 method overrides MinorUnitsConverterInterface::toMinorUnits()
MinorUnitsConverter::toMinorUnits in src/MinorUnitsConverter.php
Converts the given amount to its minor units.

File

src/MinorUnitsConverterInterface.php, line 36

Class

MinorUnitsConverterInterface
Allows converting between Price objects (decimal) and minor units (integer).

Namespace

Drupal\price

Code

public function toMinorUnits(Price $amount) : int;