public function AdjustmentTransformerInterface::roundAdjustments in Commerce Core 8.2
Rounds adjustments to their currency precision.
For example, USD adjustments will be rounded to 2 decimals.
Parameters
\Drupal\commerce_order\Adjustment[] $adjustments: The adjustments.
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 value
\Drupal\commerce_order\Adjustment[] The rounded adjustments.
1 method overrides AdjustmentTransformerInterface::roundAdjustments()
- AdjustmentTransformer::roundAdjustments in modules/
order/ src/ AdjustmentTransformer.php - Rounds adjustments to their currency precision.
File
- modules/
order/ src/ AdjustmentTransformerInterface.php, line 65
Class
- AdjustmentTransformerInterface
- Provides common logic for processing and transforming adjustments.
Namespace
Drupal\commerce_orderCode
public function roundAdjustments(array $adjustments, $mode = PHP_ROUND_HALF_UP);