示例#1
0
 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);
 }
示例#2
0
 public function getconversionrate()
 {
     App::import("Model", "CurrencyExchange");
     $currency = new CurrencyExchange();
     $getConversionRate = $currency->find('all', array('order' => array('CurrencyExchange.date' => 'DESC')));
     return $getConversionRate;
 }
示例#3
0
 /**
  * 
  * 
  * @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));
 }