}
$rates['RMB'] = $rates['CNY'] ;
- foreach($rates as $cur=>$rate) {
+ foreach($rates as $cur=>$euro) {
+
+
+ $rate = $this->rates['USD'] * $euro;
+
+
+
+
+
+
+
$ov = DB_DataObject::Factory('core_curr_rate');
$ov->curr = $cur;
}
+ function convertCurrency($val, $from, $to)
+ {
+ $r = $this->loadRates();
+ if ($r === false) {
+ return false;
+ }
+ if (!isset($this->rates[$from]) || !isset($this->rates[$to]) ) {
+ return false;
+ }
+ //echo '<PRE>';print_R($this->rates);
+ $base = (1.0 / $this->rates[$from]) * $val;
+
+ return $this->rates[$to] * $base;
+ }