src/MoneyBag.php
public function getAmount($currency) : BigRational
    {
        $currencyCode = (string) $currency;

        return isset($this->amounts[$currencyCode])
            ? $this->amounts[$currencyCode]
            : BigRational::zero();
    }
public function getAmount($currency) : BigRational
    {
        $currencyCode = (string) $currency;

        return isset($this->amounts[$currencyCode])
            ? $this->amounts[$currencyCode]
            : BigRational::zero();
    }
public function getAmount ( $ currency ) : BigRational { $ currencyCode = ( string ) $ currency ; return isset ( $ this -> amounts [ $ currencyCode ] ) ? $ this -> amounts [ $ currencyCode ] : BigRational :: zero ( ) ; }
Returns the amount in the given currency contained in the bag, as a rational number.

@param Currency|string $currency The Currency instance or currency code.

@return BigRational
Returns the amount in the given currency contained in the bag as a rational number .