public function convert($fv, $fc, $tc) { using('lepton.web.forex'); $cc = new CurrencyExchange(); $tv = $cc->convert($fv, $fc, $tc); console::writeLn("%0.2f %s = %0.2f %s", $fv, $fc, $tv, $tc); }
public function getconversionrate() { App::import("Model", "CurrencyExchange"); $currency = new CurrencyExchange(); $getConversionRate = $currency->find('all', array('order' => array('CurrencyExchange.date' => 'DESC'))); return $getConversionRate; }
/** * * * @param type $currency * @return type */ function convert($currency) { $cc = new CurrencyExchange(); return new CurrencyAmount($cc->convert($this->amount, $this->symbol, $currency), $currency); // return sprintf('%s %.2f', $currency, $cc->convert($this->amount, $this->symbol, $currency)); }