interface RounderInterface in Price 8
Same name and namespace in other branches
- 3.x src/RounderInterface.php \Drupal\price\RounderInterface
- 2.0.x src/RounderInterface.php \Drupal\price\RounderInterface
- 2.x src/RounderInterface.php \Drupal\price\RounderInterface
- 3.0.x src/RounderInterface.php \Drupal\price\RounderInterface
Rounds prices.
Hierarchy
- interface \Drupal\price\RounderInterface
Expanded class hierarchy of RounderInterface
All classes that implement RounderInterface
File
- src/RounderInterface.php, line 8 
Namespace
Drupal\priceView source
interface RounderInterface {
  /**
   * Rounds the given price to its currency precision.
   *
   * For example, USD prices will be rounded to 2 decimals.
   *
   * @param \Drupal\price\Price $price
   *   The price.
   * @param int $mode
   *   The rounding mode. One of the following constants: PHP_ROUND_HALF_UP,
   *   PHP_ROUND_HALF_DOWN, PHP_ROUND_HALF_EVEN, PHP_ROUND_HALF_ODD.
   *
   * @return \Drupal\price\Price
   *   The rounded price.
   *
   * @throws \InvalidArgumentException
   *   When given a price with an unknown currency.
   */
  public function round(Price $price, $mode = PHP_ROUND_HALF_UP);
}Members
| Name   | Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| RounderInterface:: | public | function | Rounds the given price to its currency precision. | 1 | 
