public function convertBaseRatesToUSD() : Rates
    {
        if (!empty($this->rates)) {
            if ($this->base !== 'USD') {
                if (!empty($this->rates['USD'])) {
                    $usdrate = $this->rates['USD'];
                    foreach ($this->rates as $key => $rate) {
                        $newrates[$key] = $rate * (1 / $usdrate);
                    }
                }
            }
        }
        if (!empty($newrates)) {
            $this->rates = $newrates;
            $this->base = 'USD';
        }

        return $this;
    }
public function convertBaseRatesToUSD() : Rates
    {
        if (!empty($this->rates)) {
            if ($this->base !== 'USD') {
                if (!empty($this->rates['USD'])) {
                    $usdrate = $this->rates['USD'];
                    foreach ($this->rates as $key => $rate) {
                        $newrates[$key] = $rate * (1 / $usdrate);
                    }
                }
            }
        }
        if (!empty($newrates)) {
            $this->rates = $newrates;
            $this->base = 'USD';
        }

        return $this;
    }
public function convertBaseRatesToUSD ( ) : Rates { if ( ! empty ( $ this -> rates ) ) { if ( $ this -> base !== 'USD' ) { if ( ! empty ( $ this -> rates [ 'USD' ] ) ) { $ usdrate = $ this -> rates [ 'USD' ] ; foreach ( $ this -> rates as $ key => $ rate ) { $ newrates [ $ key ] = $ rate * ( 1 / $ usdrate ) ; } } } } if ( ! empty ( $ newrates ) ) { $ this -> rates = $ newrates ; $ this -> base = 'USD' ; } return $ this ; }
Convert rates to USD

@return Rates
Convert rates to USD