public function getRate($code)
    {
        // the result won't have the base code in it,
        // because that would always be 1. But to make
        // dynamic code easier this prevents null if
        // the base code is asked for
        if ($code == $this->getBase()) {
            return 1.0;
        }

        if (isset($this->rates[$code])) {
            return $this->rates[$code];
        }
        return null;
    }
public function getRate($code)
    {
        // the result won't have the base code in it,
        // because that would always be 1. But to make
        // dynamic code easier this prevents null if
        // the base code is asked for
        if ($code == $this->getBase()) {
            return 1.0;
        }

        if (isset($this->rates[$code])) {
            return $this->rates[$code];
        }
        return null;
    }
public function getRate ( $ code ) { // the result won't have the base code in it, // because that would always be 1. But to make // dynamic code easier this prevents null if // the base code is asked for if ( $ code == $ this -> getBase ( ) ) { return 1.0 ; } if ( isset ( $ this -> rates [ $ code ] ) ) { return $ this -> rates [ $ code ] ; } return null ; }
Get an individual rate by Currency code
Will return null if currency is not found in the result

@param string $code
@return float|null
Get an individual rate by Currency code Will return null if currency is not found in the result