本文整理汇总了PHP中currency_format函数的典型用法代码示例。如果您正苦于以下问题:PHP currency_format函数的具体用法?PHP currency_format怎么用?PHP currency_format使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了currency_format函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getData
public function getData($days)
{
$key_column = array('type' => 'string', 'title' => get_exchange_name($this->exchange));
$columns = array();
$columns[] = array('type' => 'string', 'title' => ct("Price"), 'heading' => true);
$columns[] = array('type' => 'string', 'title' => ct("Value"));
$data = array();
$q = db()->prepare("SELECT * FROM ticker_recent WHERE exchange=:exchange AND currency1=:currency1 AND currency2=:currency2");
$q->execute(array('exchange' => $this->exchange, 'currency1' => $this->currency1, 'currency2' => $this->currency2));
if ($ticker = $q->fetch()) {
$last_updated = $ticker['created_at'];
$data[] = array('Bid', currency_format($this->currency1, $ticker['bid'], 4));
$data[] = array('Ask', currency_format($this->currency1, $ticker['ask'], 4));
} else {
throw new GraphException(t("No recent rates found for :exchange :pair", $this->getTitleArgs()));
}
return array('key' => $key_column, 'columns' => $columns, 'data' => $data, 'last_updated' => $last_updated, 'no_header' => true);
}
示例2: getData
/**
* We need to transpose the returned data, both data and columns.
*/
public function getData($days)
{
$original = parent::getData($days);
$columns = array();
$columns[] = array('type' => 'string', 'title' => ct("Total :currency"), 'args' => array(':currency' => get_currency_abbr($this->currency)), 'heading' => true);
$data = array();
$total = 0;
foreach ($original['data'] as $key => $row) {
foreach ($row as $i => $value) {
$data[] = array($original['columns'][$i]['title'], currency_format($this->currency, $value, 4));
$total += $value;
}
}
// 'Total BTC' column
$columns[] = array('type' => 'string', 'title' => currency_format($this->currency, $total, 4));
// save for later
$this->total = $total;
return array('key' => $original['key'], 'columns' => $columns, 'data' => $data, 'last_updated' => $original['last_updated']);
}
示例3: getData
public function getData($days)
{
$key_column = array('type' => 'string', 'title' => ct("Currency"));
$columns = array();
$columns[] = array('type' => 'string', 'title' => ct("Currency"), 'heading' => true);
$columns[] = array('type' => 'string', 'title' => ct("Total"));
// a table of each currency
// get all balances
$balances = get_all_summary_instances($this->getUser());
$summaries = get_all_summary_currencies($this->getUser());
$currencies = get_all_currencies();
$last_updated = find_latest_created_at($balances, "total");
// create data
$data = array();
foreach ($currencies as $c) {
if (isset($summaries[$c])) {
$balance = isset($balances['total' . $c]) ? $balances['total' . $c]['balance'] : 0;
$data[] = array("<span title=\"" . htmlspecialchars(get_currency_name($c)) . "\">" . get_currency_abbr($c) . "</span>", currency_format($c, demo_scale($balance), 4));
}
}
return array('key' => $key_column, 'columns' => $columns, 'data' => $data, 'last_updated' => $last_updated, 'add_more_currencies' => true, 'no_header' => true);
}
示例4: getData
public function getData($days)
{
$key_column = array('type' => 'string', 'title' => ct("Currency"));
$columns = array();
$columns[] = array('type' => 'string', 'title' => ct("Exchange"), 'heading' => true);
$columns[] = array('type' => 'string', 'title' => ct("Converted fiat"));
// a table of each crypto2xxx value
// get all balances
$currencies = get_crypto_conversion_summary_types($this->getUser());
$last_updated = false;
// create data
$data = array();
foreach ($currencies as $key => $c) {
$q = db()->prepare("SELECT * FROM summary_instances WHERE user_id=? AND summary_type=? AND is_recent=1");
$q->execute(array($this->getUser(), "crypto2" . $key));
if ($balance = $q->fetch()) {
$data[] = array($c['short_title'], currency_format($c['currency'], demo_scale($balance['balance']), 4));
$last_updated = max($last_updated, strtotime($balance['created_at']));
}
}
return array('key' => $key_column, 'columns' => $columns, 'data' => $data, 'last_updated' => $last_updated, 'add_more_currencies' => true, 'no_header' => true);
}
示例5: getData
public function getData($days)
{
$columns = array();
$key_column = array('type' => 'string', 'title' => ct("Key"));
$columns[] = array('type' => 'string', 'title' => ct("Exchange"), 'heading' => true);
$columns[] = array('type' => 'string', 'title' => ct("Price"));
$columns[] = array('type' => 'string', 'title' => ct("Volume"));
$q = db()->prepare("SELECT * FROM ticker_recent WHERE currency1=? AND currency2=? ORDER BY volume DESC");
$q->execute(array($this->currency1, $this->currency2));
$tickers = $q->fetchAll();
$q = db()->prepare("SELECT * FROM average_market_count WHERE currency1=? AND currency2=?");
$q->execute(array($this->currency1, $this->currency2));
$market_count = $q->fetch();
$average = false;
foreach ($tickers as $ticker) {
if ($ticker['exchange'] == 'average') {
$average = $ticker;
}
}
if (!$average) {
throw new RenderGraphException(t("Could not find any average data"));
}
$volume_currency = $average['currency2'];
// generate the table of data
$data = array();
foreach ($tickers as $ticker) {
if ($ticker['exchange'] == "average") {
continue;
}
if ($ticker['volume'] == 0) {
continue;
}
$id = $ticker['exchange'] . "_" . $ticker['currency1'] . $ticker['currency2'] . "_daily";
$data[$ticker['exchange']] = array("<a href=\"" . htmlspecialchars(url_for('historical', array('id' => $id, 'days' => 180))) . "\">" . get_exchange_name($ticker['exchange']) . "</a>", $this->average_currency_format_html($ticker['last_trade'], $ticker['last_trade']), currency_format($volume_currency, $ticker['volume'], 0) . " (" . ($average['volume'] == 0 ? "-" : number_format($ticker['volume'] * 100 / $average['volume']) . "%") . ")");
}
$last_updated = $average['created_at'];
return array('key' => $key_column, 'columns' => $columns, 'data' => $data, 'last_updated' => $last_updated, 'h1' => get_currency_abbr($average['currency1']) . "/" . get_currency_abbr($average['currency2']) . ": " . currency_format($average['currency1'], $average['last_trade']), 'h2' => "(" . number_format($average['volume']) . " " . get_currency_abbr($volume_currency) . " total volume)");
}
示例6: currency_format
">
<div class="featured-menu">
<div class="menu-thumb">
<img src="<?php
echo $menu['menu_photo'];
?>
" alt="" />
</div>
<div class="menu-content">
<div class="content-show">
<h4><?php
echo $menu['menu_name'];
?>
</h4>
<span><?php
echo currency_format($menu['menu_price']);
?>
</span>
</div>
<div class="content-hide">
<p><?php
echo $menu['menu_description'];
?>
</p>
</div>
</div>
</div>
</div>
<?php
}
?>
示例7: date
if ($invoiceID) {
$invoice = $ISL->FetchInvoiceDetails($invoiceID);
$client = $ISL->FetchClientDetails($invoice['clientid']);
$admin = $ISL->FetchAdminDetails($client['parentclientid']);
$invoice['show_tax'] = $invoice['calc_tax'] > 0 ? true : false;
$invoice['show_tax2'] = $invoice['calc_tax2'] > 0 ? true : false;
$invoice['show_shipping'] = $invoice['shipping'] > 0 ? true : false;
$invoice['terms'] = $invoice['terms'] ? $invoice['terms'] : ($client['def_terms'] ? $client['def_terms'] : ($admin['def_terms'] ? $admin['def_terms'] : $lang['terms']));
$invoice['comments'] = $invoice['comments'] ? $invoice['comments'] : ($client['def_comments'] ? $client['def_comments'] : ($admin['def_comments'] ? $admin['def_comments'] : ''));
$invoice['due_date'] = date($SYSTEM["regional"]["invoicedate"], $invoice['due_date']);
$invoice['issue_date'] = date($SYSTEM["regional"]["invoicedate"], $invoice['issue_date']);
$invoice['calc_tax'] = currency_format($invoice['calc_tax']);
$invoice['calc_tax2'] = currency_format($invoice['calc_tax2']);
$invoice['shipping'] = currency_format($invoice['shipping']);
$invoice['cost'] = currency_format($invoice['cost']);
$invoice['total'] = currency_format($invoice['total']);
$emailSendID = $ISL->addEmailSend($invoice['clientid'], $invoiceID, $client['email'], 1);
$e = new Emailer();
$e->setMainFile('forms/email_invoice.tpl');
$e->setFrom($SYSTEM['email']['from']);
$e->setFromName($SYSTEM['email']['fromName']);
$e->setSubject($lang['eml_subj_invoice']);
$e->set('SYSTEM', $SYSTEM);
$e->set('invoice', $invoice);
$e->set('client', $client);
$e->set('admin', $admin);
$ispayed = strtolower($invoice['curr_status']) == 'fully paid' ? true : false;
$e->set('ispayed', $ispayed);
$e->fetchMessage();
$e->appendMessage('<img src="' . HTTP_ROOT . 'isop.php?sid=' . $emailSendID . '" width="1" height="1">');
$e->setRecipient($client['email']);
示例8: _e
?>
<?php
_e($key);
?>
<?php
} else {
?>
<?php
print $key;
?>
<?php
}
?>
:</small>
<?php
print currency_format($v);
?>
</span>
</div>
<?php
}
}
?>
</div>
<?php
}
?>
<module type="custom_fields" data-content-id="<?php
print intval($for_id);
?>
示例9: precision
private function precision()
{
$format = currency_format();
return $format['precision'];
}
示例10: number_format
$reward_points += $components_reward_points;
$product_params["base_reward_points"] = $reward_points;
if ($reward_type) {
$t->set_var("reward_points", number_format($reward_points, $points_decimals));
$t->parse("reward_points_block", false);
} else {
$t->set_var("reward_points_block", "");
}
}
// show reward credits
if ($credit_system && $reward_credits_details && ($reward_credits_users == 0 || $reward_credits_users == 1 && $user_id)) {
$reward_credits = calculate_reward_credits($credit_reward_type, $credit_reward_amount, $item_price, $buying_price);
$reward_credits += $components_reward_credits;
$product_params["base_reward_credits"] = $reward_credits;
if ($credit_reward_type) {
$t->set_var("reward_credits", currency_format($reward_credits));
$t->parse("reward_credits_block", false);
} else {
$t->set_var("reward_credits_block", "");
}
}
$recent_price = 0;
$product_params["pe"] = 0;
if ($display_products != 2 || strlen($user_id)) {
set_quantity_control($quantity_limit, $stock_level, $quantity_control, $min_quantity, $max_quantity, $quantity_increment);
// calculate recent price
$recent_price = calculate_price($price, $is_sales, $sales_price);
$recent_price += $properties_price;
$base_price = calculate_price($price, $is_sales, $sales_price);
$product_params["base_price"] = $base_price;
if ($is_price_edit) {
示例11: floor
} else {
?>
<td>
<?php
$duration = $report['consultation_duration'];
$hours = floor($duration / 3600);
$minutes = floor($duration / 60 % 60);
$seconds = $duration % 60;
echo "{$hours}:{$minutes}:{$seconds}";
?>
</td>
<?php
}
?>
<!--td class="right"><?php
echo currency_format($report['collection_amount']);
if ($currency_postfix) {
echo $currency_postfix['currency_postfix'];
}
?>
</td-->
</tr>
<?php
$i++;
?>
<?php
}
?>
</tbody>
<?php
示例12: sprintf
}
}
?>
<?php
echo $title;
?>
- <span><?php
echo $description;
?>
</span>
</label>
<?php
if ($minimum_order_total >= $order_total) {
?>
<br /><span class="text-info"><?php
echo sprintf(lang('alert_min_order_total'), currency_format($minimum_order_total));
?>
</span>
<?php
}
?>
</div>
<div id="stripe-payment" class="wrap-horizontal" style="<?php
echo $payment === 'authorize_net_aim' ? 'display: block;' : 'display: none;';
?>
">
<?php
if (!empty($stripe_token)) {
?>
<input type="hidden" name="stripe_token" value="<?php
echo $stripe_token;
示例13: _e
?>
</td>
</tr>
<?php
}
?>
<tr class="mw-ui-table-footer">
<td colspan="3" style="padding-top: 37px;"> </td>
<td class="mw-ui-table-green">
<strong><?php
_e("Total");
?>
:</strong>
</td>
<td class="nowrap"><b><?php
print currency_format($grandtotal);
?>
</b></td>
</tr>
</tbody>
</table>
<?php
} else {
?>
<h2>
<?php
_e("The cart is empty");
?>
</h2>
<?php
}
示例14: date
<?php
$bill_date = date('d-m-Y', strtotime($report['bill_date']));
?>
<td><?php
echo $bill_date;
?>
</td>
<td><?php
echo currency_format($report['total_amount']);
if ($currency_postfix) {
echo $currency_postfix['currency_postfix'];
}
?>
</td>
<td><?php
echo currency_format($report['due_amount']);
if ($currency_postfix) {
echo $currency_postfix['currency_postfix'];
}
?>
</td>
</tr>
<?php
}
?>
<script>
$(window).load(function() {
$('#bill_table').dataTable();
});
</script>
示例15: check_add_coupons
//.........这里部分代码省略.........
}
// global options
$is_exclusive = $data["is_exclusive"];
$quantity_limit = $data["quantity_limit"];
$coupon_uses = $data["coupon_uses"];
// check cart total values
$min_cart_quantity = $data["min_cart_quantity"];
$max_cart_quantity = $data["max_cart_quantity"];
$min_cart_cost = $data["min_cart_cost"];
$max_cart_cost = $data["max_cart_cost"];
if ($discount_type <= 2) {
$cart_items_all = 1;
}
// for order coupons always use all cart products to calculate totals
check_cart_totals($cart_quantity, $cart_cost, $shopping_cart, $cart_items_all, $cart_items_ids, $cart_items_types_ids);
// product specific fields
$min_quantity = $data["min_quantity"];
$max_quantity = $data["max_quantity"];
$minimum_amount = $data["minimum_amount"];
$maximum_amount = $data["maximum_amount"];
// check if coupon can be applied
if (!$is_active) {
$coupon_error = COUPON_NON_ACTIVE_MSG;
} elseif ($quantity_limit > 0 && $coupon_uses >= $quantity_limit) {
$coupon_error = COUPON_USED_MSG;
} elseif ($is_expired) {
$coupon_error = COUPON_EXPIRED_MSG;
} elseif ($is_upcoming) {
$coupon_error = COUPON_UPCOMING_MSG;
} elseif (($exclusive_applied || $is_exclusive && $coupons_total > 0) && $discount_type != 5 && !is_only_gift_certificate()) {
//Customization by Vital - allow gift cert. with other coupons
$coupon_error = COUPON_EXCLUSIVE_MSG;
} elseif ($discount_type <= 4 && $min_cart_cost > $cart_cost) {
$coupon_error = str_replace("{cart_amount}", currency_format($min_cart_cost), MIN_CART_COST_ERROR);
} elseif ($discount_type <= 4 && $max_cart_cost && $max_cart_cost < $cart_cost) {
$coupon_error = str_replace("{cart_amount}", currency_format($max_cart_cost), MAX_CART_COST_ERROR);
} elseif ($discount_type <= 4 && $min_cart_quantity > $cart_quantity) {
$coupon_error = str_replace("{min_quantity}", $min_cart_quantity, COUPON_MIN_QTY_ERROR);
} elseif ($discount_type <= 4 && $max_cart_quantity && $max_cart_quantity < $cart_quantity) {
$coupon_error = str_replace("{max_quantity}", $max_cart_quantity, COUPON_MAX_QTY_ERROR);
} elseif (!($users_all || $user_id && in_array($user_id, $search_users_ids) || $user_type_id && in_array($user_type_id, $search_users_types_ids))) {
$coupon_error = COUPON_CANT_BE_USED_MSG;
// coupon can't be used for current user
} elseif ($users_use_limit && !$user_not_limited) {
// coupon can't be used more times
if ($users_use_limit == 1) {
$coupon_error = COUPON_CAN_BE_USED_ONCE_MSG;
} else {
$coupon_error = str_replace("{use_limit}", $users_use_limit, COUPON_SAME_USE_LIMIT_MSG);
}
} elseif ($friends_discount_type > 0 && !$friends_coupon) {
$coupon_error = COUPON_CANT_BE_USED_MSG;
// coupon has friends options which can't be used for current user
} elseif (($orders_min_goods || $orders_max_goods) && !$orders_goods_coupon) {
$coupon_error = COUPON_CANT_BE_USED_MSG;
// the sum of user purchased goods doesn't match with goods values for this coupon
}
// end coupons checks
if (!$coupon_error) {
// check products coupons
$coupon_items = false;
foreach ($shopping_cart as $cart_id => $item) {
$item_id = $item["ITEM_ID"];
$item_type_id = $item["ITEM_TYPE_ID"];
$properties_more = $item["PROPERTIES_MORE"];
//Customization by Vital