/**
  * convert
  */
 function convert($value, $from, $to)
 {
     require_once 'models/international/international_currency_rate.php';
     $Currency_rate = new international_currency_rate();
     if ($from == $to) {
         return $value;
     } else {
         $result = $Currency_rate->convert($value, $from, $to);
     }
     return $result;
 }
Example #2
0
 /**
  * getExchangeRate
  */
 public function getExchangeRate($currency_code)
 {
     if ($currency_code != GLOBAL_DEFAULT_CURRENCY) {
         require_once 'models/international/international_currency_rate.php';
         $Currency = new international_currency_rate();
         $exchange_rate = $Currency->getLatestExchangeRate(GLOBAL_DEFAULT_CURRENCY, $currency_code);
     } else {
         $exchange_rate = 1;
     }
     return (double) $exchange_rate;
 }
Example #3
0
 /**
  * convert currency
  */
 static function convertCurrency($value, $from, $to)
 {
     require_once 'models/international/international_currency_rate.php';
     $Currency = new international_currency_rate();
     $destination_value = $Currency->convert($value, $from, $to);
     return $destination_value;
 }