本文整理汇总了PHP中Change::usd2eur方法的典型用法代码示例。如果您正苦于以下问题:PHP Change::usd2eur方法的具体用法?PHP Change::usd2eur怎么用?PHP Change::usd2eur使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Change
的用法示例。
在下文中一共展示了Change::usd2eur方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _populate_transactions
function _populate_transactions()
{
$conn = $this->get_connection();
if (count($this->transactions) > 0) {
foreach ($this->transactions as $transaction) {
$transaction->stock = new Stock();
$transaction->stock->find_by_id($transaction->isin);
$transaction->importo = 0;
$parts = $transaction->find_all(array('where_clause' => "`negot_id` = '{$conn->escape($transaction->negot_id)}'"));
if (count($parts) > 0) {
foreach ($parts as $part) {
$importo = $part->quantita * $part->prezzo;
$importo /= $transaction->stock->divisa == 'USD' ? Change::usd2eur($part->data) : 1;
$importo *= $part->azione == 'acquisto' ? -1 : 1;
$importo /= $transaction->stock->tipo == 'obbligazione' ? 100 : 1;
$comm = abs($importo) * $this->preference->comm_percent;
if (strtotime($part->data) >= strtotime("2007-08-01")) {
$comm = $comm > $this->preference->comm_percent_min ? $comm : $this->preference->comm_percent_min;
}
$importo -= $comm;
$importo -= $this->preference->comm_fissa;
$transaction->importo += $importo;
}
}
$this->bilancio += $transaction->importo;
}
}
}
示例2: PortfolioStock
<tr class="row0">
<td class="cell10"><div class="vstrut17"></div></td>
<td class="cell10">Dividendo</td>
<td class="cell10"><b><?php
print $dividend->pretty_date();
?>
</b></td>
<td class="cell10"><?php
$portfolio = new PortfolioStock();
$ports = $portfolio->find_all(array('where_clause' => "`isin` = '{$this->stock->isin}'"));
if (count($ports) > 0) {
$port = $ports[0];
$revenue = $port->quantita * $dividend->importo;
printf('%.2f %s', $revenue, $this->stock->divisa);
if ($this->stock->divisa != 'EUR') {
$revenue /= $this->stock->divisa == 'USD' ? Change::usd2eur() : 1;
printf(' (%.2f EUR)', $revenue);
}
}
?>
<?php
printf('(%.2f%%)', $dividend->importo / $this->stock->last->quotazione * 100);
?>
</td>
<td class="cell10"><b><?php
printf('%s %s', $dividend->amount(), $this->stock->divisa);
?>
</b></td>
</tr>
<?php