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); }
/** * * * @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)); }