/** * Returns a Money with this value, and a given number of fraction digits. * * @param int $fractionDigits The number of fraction digits. * @param int $roundingMode The rounding mode to apply, if necessary. * * @return Money */ public function withFractionDigits($fractionDigits, $roundingMode = RoundingMode::UNNECESSARY) { return new Money($this->amount->toScale($fractionDigits, $roundingMode), $this->currency); }