src/AbstractMoney.php
final public function to(Context $context, int $roundingMode = RoundingMode::UNNECESSARY) : Money
    {
        return Money::create($this->getAmount(), $this->getCurrency(), $context, $roundingMode);
    }
final public function to(Context $context, int $roundingMode = RoundingMode::UNNECESSARY) : Money
    {
        return Money::create($this->getAmount(), $this->getCurrency(), $context, $roundingMode);
    }
final public function to ( Context $ context , int $ roundingMode = RoundingMode :: UNNECESSARY ) : Money { return Money :: create ( $ this -> getAmount ( ) , $ this -> getCurrency ( ) , $ context , $ roundingMode ) ; }
Converts this money to a Money in the given Context.

@param Context $context      The context.
@param int     $roundingMode The rounding mode, if necessary.

@return Money

@throws RoundingNecessaryException If RoundingMode::UNNECESSARY is used but rounding is necessary.
Converts this money to a Money in the given Context .