public function convert($currency)
    {
        if ($this->isAvailable($currency)) {
            $rate = 1 / $this->rates[$currency];
            return round($this->base * $rate, 2);
        } else {
            throw new RuntimeException(sprintf(
                'Target currency "%s" does not belong to the registered map of rates', $currency
            ));
        }
    }
public function convert($currency)
    {
        if ($this->isAvailable($currency)) {
            $rate = 1 / $this->rates[$currency];
            return round($this->base * $rate, 2);
        } else {
            throw new RuntimeException(sprintf(
                'Target currency "%s" does not belong to the registered map of rates', $currency
            ));
        }
    }
public function convert ( $ currency ) { if ( $ this -> isAvailable ( $ currency ) ) { $ rate = 1 / $ this -> rates [ $ currency ] ; return round ( $ this -> base * $ rate , 2 ) ; } else { throw new RuntimeException ( sprintf ( 'Target currency "%s" does not belong to the registered map of rates' , $ currency ) ) ; } }
Returns converted value

@param string $currency
@throws \RuntimeException if target currency doesn't belong to the map of rates
@return float
Returns converted value