本文整理匯總了PHP中CCurrencyLang::CurrencyFormat方法的典型用法代碼示例。如果您正苦於以下問題:PHP CCurrencyLang::CurrencyFormat方法的具體用法?PHP CCurrencyLang::CurrencyFormat怎麽用?PHP CCurrencyLang::CurrencyFormat使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CCurrencyLang
的用法示例。
在下文中一共展示了CCurrencyLang::CurrencyFormat方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: formatToBaseCurrency
public static function formatToBaseCurrency($value, $format = null)
{
static $module, $baseCurrency;
if (!$module) {
$module = Loader::includeModule('currency');
$baseCurrency = Config::getBaseCurrency();
}
if ($module) {
$value = \CCurrencyLang::CurrencyFormat($value, $baseCurrency);
}
return $value;
}
示例2: SaleFormatCurrency
function SaleFormatCurrency($fSum, $strCurrency, $OnlyValue = false, $withoutFormat = false)
{
if ($withoutFormat === true) {
if ($fSum === '') {
return '';
}
$currencyFormat = CCurrencyLang::GetFormatDescription($strCurrency);
if ($currencyFormat === false) {
$currencyFormat = CCurrencyLang::GetDefaultValues();
}
$intDecimals = $currencyFormat['DECIMALS'];
if (round($fSum, $currencyFormat["DECIMALS"]) == round($fSum, 0)) {
$intDecimals = 0;
}
return number_format($fSum, $intDecimals, '.', '');
}
return CCurrencyLang::CurrencyFormat($fSum, $strCurrency, !($OnlyValue === true));
}
示例3: roundEx
$row->AddCheckField("LAST_DISCOUNT");
}
}
if ($arSelectFieldsMap['VALUE']) {
$strDiscountValue = '';
if ($arDiscount["VALUE_TYPE"] == CCatalogDiscount::TYPE_PERCENT) {
$strDiscountValue = roundEx($arDiscount["VALUE"], CATALOG_VALUE_PRECISION) . "%";
} elseif ($arDiscount["VALUE_TYPE"] == CCatalogDiscount::TYPE_SALE) {
$strDiscountValue = '= ' . CCurrencyLang::CurrencyFormat($arDiscount["VALUE"], $arDiscount["CURRENCY"], true);
} else {
$strDiscountValue = CCurrencyLang::CurrencyFormat($arDiscount["VALUE"], $arDiscount["CURRENCY"], true);
}
$row->AddViewField("VALUE", $strDiscountValue);
}
if ($arSelectFieldsMap['MAX_DISCOUNT']) {
$row->AddViewField("MAX_DISCOUNT", 0 < $arDiscount['MAX_DISCOUNT'] ? CCurrencyLang::CurrencyFormat($arDiscount['MAX_DISCOUNT'], $arDiscount["CURRENCY"], true) : GetMessage('DSC_MAX_DISCOUNT_UNLIM'));
}
if ($arSelectFieldsMap['RENEWAL']) {
$row->AddCheckField("RENEWAL", false);
}
$arActions = array();
$arActions[] = array("ICON" => "edit", "TEXT" => GetMessage("DSC_UPDATE_ALT"), "ACTION" => $lAdmin->ActionRedirect("/bitrix/admin/cat_discount_edit.php?ID=" . $arDiscount['ID'] . "&lang=" . LANGUAGE_ID . GetFilterParams("filter_", false) . ""), "DEFAULT" => true);
if (!$bReadOnly) {
$arActions[] = array("ICON" => "copy", "DEFAULT" => false, "TEXT" => GetMessage("BT_CAT_DISCOUNT_ADM_CONT_COPY"), "ACTION" => $lAdmin->ActionRedirect("/bitrix/admin/cat_discount_edit.php?ID=" . $arDiscount['ID'] . '&action=copy&lang=' . LANGUAGE_ID));
$arActions[] = array("SEPARATOR" => true);
$arActions[] = array("ICON" => "delete", "TEXT" => GetMessage("DSC_DELETE_ALT"), "ACTION" => "if(confirm('" . GetMessageJS('DSC_DELETE_CONF') . "')) " . $lAdmin->ActionDoGroup($arDiscount['ID'], "delete"));
}
$row->AddActions($arActions);
}
if (isset($row)) {
unset($row);
示例4: isset
}
$balance = isset($arCatalogProduct["STORE_AMOUNT"]) ? FloatVal($arCatalogProduct["QUANTITY"]) . " / " . FloatVal($arCatalogProduct["STORE_AMOUNT"]) : FloatVal($arCatalogProduct["QUANTITY"]);
$row->AddField("BALANCE", $arItems['TYPE'] != 'S' ? $balance : '');
if ($arItems['TYPE'] != 'S') {
$ratio = isset($arCatalogProduct['MEASURE_RATIO']) ? $arCatalogProduct['MEASURE_RATIO'] : 1;
$measure = isset($arCatalogProduct['MEASURE']['SYMBOL_RUS']) ? ' ' . $arCatalogProduct['MEASURE']['SYMBOL_RUS'] : '';
$arParams = array('id' => $arItems["ID"], 'type' => $arCatalogProduct["TYPE"], 'name' => $arItems['NAME'], 'full_quantity' => $arCatalogProduct['QUANTITY'], 'measureRatio' => isset($arCatalogProduct['MEASURE_RATIO']) ? $arCatalogProduct['MEASURE_RATIO'] : 1, 'measure' => isset($arCatalogProduct['MEASURE']['~SYMBOL_RUS']) ? $arCatalogProduct['MEASURE']['~SYMBOL_RUS'] : '', 'quantity' => $ratio);
$row->AddField("QUANTITY", '<input type="text" id="' . $tableId . '_qty_' . $arItems["ID"] . '" value="' . $ratio . '" size="5" />' . $measure);
unset($measure, $ratio);
$arActions[] = array("TEXT" => GetMessage("SPS_SELECT"), "DEFAULT" => "Y", "ACTION" => $tableId . '_helper.SelEl(' . CUtil::PhpToJSObject($arParams) . ', this);');
$row->AddField("ACTION", '<a class="select-sku">' . GetMessage('SPS_SELECT') . '</a>');
} else {
$arActions[] = array("TEXT" => GetMessage("SPS_SELECT"), "DEFAULT" => "Y", "ACTION" => $tableId . '_helper.onSectionClick(' . $arItems["ID"] . ',\'' . CUtil::JSEscape($arItems['NAME']) . '\');');
}
foreach ($arPrices as $price) {
$row->AddViewField("PRICE" . $price['ID'], CCurrencyLang::CurrencyFormat($arItems['PRICES'][$price['ID']]['PRICE'], $arItems['PRICES'][$price['ID']]['CURRENCY'], true));
}
}
addPropsCell($row, $arSelectedProps, $arItems);
$row->AddViewField('NAME', '<a class="adm-list-table-link"><span class="bx-s-iconset ' . $icon . '"></span>' . htmlspecialcharsex($arItems['NAME']) . '</a>');
$row->AddActions($arActions);
}
$lAdmin->BeginEpilogContent();
?>
<script type="text/javascript">
<?php
foreach ($arSku as $k => $v) {
?>
if (BX('<?php
echo $tableId;
?>
示例5:
<tr>
<td width="30%" class="adm-detail-required-field"><?=Loc::getMessage('SEO_YANDEX_STATS_PERIOD')?>:</td>
<td width="70%">
<span style="white-space: nowrap; display:inline-block;"><select name="period_sel" onchange="setGraphInterval(this.value)">
<option value="interval"><?=Loc::getMessage('SEO_YANDEX_STATS_GRAPH_INTERVAL')?></option>
<option value="week_ago"><?=Loc::getMessage('SEO_YANDEX_STATS_GRAPH_WEEK')?></option>
<option value="month_ago"><?=Loc::getMessage('SEO_YANDEX_STATS_GRAPH_MONTH')?></option>
</select> <span id="seo_graph_interval"><?=CalendarDate("date_from", $dateStart->toString(), 'form1', "4")?> …<?=CalendarDate("date_to", $dateFinish->toString(), 'form1', "4")?></span></span> <input type="button" value="<?=Loc::getMessage('SEO_YANDEX_STATS_PERIOD_APPLY')?>" onclick="loadGraphData()" id="stats_loading_button" name="template_preview"><span id="stats_wait" class="loading-message-text" style="display: none; margin-top: 5px;"><?=Loc::getMessage('SEO_YANDEX_STATS_WAIT')?></span>
</td>
</tr>
<?
if($bSale):
?>
<tr>
<td><?=Loc::getMessage('SEO_YANDEX_STATS_SUM_ORDER_REPIOD')?>:</td>
<td><span id="banner_profit"><?=\CCurrencyLang::CurrencyFormat(doubleval($bannerProfit), \Bitrix\Currency\CurrencyManager::getBaseCurrency(), true)?></span></td>
</tr>
<?
endif;
?>
<tr>
<td><?=Loc::getMessage('SEO_YANDEX_STATS_GRAPH_TYPE')?>:</td>
<td><select onchange="setGraph(this.value)">
<option value="sum"><?=Loc::getMessage('SEO_YANDEX_STATS_GRAPH_TYPE_SUM')?></option>
<option value="shows"><?=Loc::getMessage('SEO_YANDEX_STATS_GRAPH_TYPE_SHOWS')?></option>
<option value="clicks"><?=Loc::getMessage('SEO_YANDEX_STATS_GRAPH_TYPE_CLICKS')?></option>
</select></td>
</tr>
<tr>
<td colspan="2">
<?
示例6: htmlspecialcharsbx
?>
</td>
<td style="text-align: left;"><?php
echo htmlspecialcharsbx($arProductDiscounts["NAME"]);
?>
</td>
<td style="text-align: right;">
<?php
if ($arProductDiscounts["VALUE_TYPE"] == "P") {
echo $arProductDiscounts["VALUE"] . "%";
} elseif ($arProductDiscounts["VALUE_TYPE"] == "S") {
?>
= <?php
echo CCurrencyLang::CurrencyFormat($arProductDiscounts["VALUE"], $arProductDiscounts["CURRENCY"], true);
} else {
echo CCurrencyLang::CurrencyFormat($arProductDiscounts["VALUE"], $arProductDiscounts["CURRENCY"], true);
}
?>
</td>
<?php
if ($bDiscount) {
?>
<td style="text-align: center;">
<a href="/bitrix/admin/cat_discount_edit.php?ID=<?php
echo $arProductDiscounts["ID"];
?>
&lang=<?php
echo LANGUAGE_ID;
?>
#tb" target="_blank"><?php
echo GetMessage("C2IT_MODIFY");
示例7: foreach
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?>
<?
if(CModule::IncludeModule("currency")){
$totalSum = 0;
foreach($arResult["ITEMS"] as $arItem){
$totalSum += $arItem["PRICE"]*$arItem["QUANTITY"];
}
$arResult["TOTAL"] = CCurrencyLang::CurrencyFormat($totalSum, "RUB");
}
示例8: GetMessage
echo 'Y' == $arItem["CUSTOM_PRICE"] ? GetMessage("SOD_BASE_CATALOG_PRICE") : $arItem["NOTES"];
?>
</div>
</td>
<?
}
if ($columnCode == "COLUMN_SUM")
{
?>
<td class="COLUMN_SUM" nowrap>
<?
if (!CSaleBasketHelper::isSetItem($arItem)):
?>
<div><?php
echo CCurrencyLang::CurrencyFormat($arItem["QUANTITY"] * $arItem["PRICE"], $arItem["CURRENCY"], false);
?>
<span><?php
echo $CURRENCY_FORMAT;
?>
</span></div>
<?
endif;
?>
</td>
<?
}
if (substr($columnCode, 0, 9) == "PROPERTY_")
{
?>
示例9: GetMessage
</div>
</td>
</tr>
<tr>
<td class="title">
<?php
echo GetMessage("NEWO_TOTAL_PAY_ACCOUNT2");
?>
</td>
<td nowrap class="sum_paid" onclick="fEditSumPaid(true);">
<span id="ORDER_PAY_FROM_ACCOUNT" style="white-space:nowrap;" onclick="fEditSumPaid(true);">
<?
$str_SUM_PAID = floatval($str_SUM_PAID);
?>
<?php
echo CCurrencyLang::CurrencyFormat($str_SUM_PAID, $str_CURRENCY, false);
?>
</span>
<span id="sum_paid_edit" style="display:none">
<input type="text"
size="5"
value="<?php
echo floatval($str_SUM_PAID);
?>
"
id="ORDER_PAY_FROM_ACCOUNT_EDIT"
name="SUM_PAID"
onblur="fEditSumPaid(false)"
maxlength="9">
</span>
示例10: Add2BasketByProductID
$ratio = 1;
if ($_POST["itemsRatio"][$itemID]) {
$ratio = $_POST["itemsRatio"][$itemID];
}
if (intval($itemID)) {
Add2BasketByProductID(intval($itemID), $ratio, array("LID" => $_POST["lid"]), $product_properties);
}
}
}
break;
case "ajax_recount_prices":
if (strlen($_POST["currency"]) > 0) {
$arPices = array("formatSum" => "", "formatOldSum" => "", "formatDiscDiffSum" => "");
if ($_POST["sumPrice"]) {
$arPices["formatSum"] = CCurrencyLang::CurrencyFormat($_POST["sumPrice"], $_POST["currency"], true);
}
if ($_POST["sumOldPrice"] && $_POST["sumOldPrice"] != $_POST["sumPrice"]) {
$arPices["formatOldSum"] = CCurrencyLang::CurrencyFormat($_POST["sumOldPrice"], $_POST["currency"], true);
}
if ($_POST["sumDiffDiscountPrice"]) {
$arPices["formatDiscDiffSum"] = CCurrencyLang::CurrencyFormat($_POST["sumDiffDiscountPrice"], $_POST["currency"], true);
}
if (SITE_CHARSET != "utf-8") {
$arPices = $APPLICATION->ConvertCharsetArray($arPices, SITE_CHARSET, "utf-8");
}
echo json_encode($arPices);
}
break;
}
die;
}
示例11: formatPrice
protected function formatPrice($price)
{
$price = \CCurrencyLang::CurrencyFormat($price, 'RUB', false);
return $price;
}
示例12: GetMessage
<h4><?php
echo $arDiscountSave['NAME'];
?>
</h4><?php
?>
<p><?php
echo GetMessage('BX_CMP_CDI_TPL_MESS_SIZE');
?>
<?php
if ('P' == $arDiscountSave['VALUE_TYPE']) {
echo $arDiscountSave['VALUE'];
?>
%<?php
} else {
echo CCurrencyLang::CurrencyFormat($arDiscountSave['VALUE'], $arDiscountSave['CURRENCY'], true);
}
if (isset($arDiscountSave['NEXT_LEVEL']) && is_array($arDiscountSave['NEXT_LEVEL'])) {
$strNextLevel = '';
if ('P' == $arDiscountSave['NEXT_LEVEL']['VALUE_TYPE']) {
$strNextLevel = $arDiscountSave['NEXT_LEVEL']['VALUE'] . ' %';
} else {
$strNextLevel = CCurrencyLang::CurrencyFormat($arDiscountSave['NEXT_LEVEL']['VALUE'], $arDiscountSave['CURRENCY'], true);
}
?>
<br /><?php
echo str_replace(array('#SIZE#', '#SUMM#'), array($strNextLevel, CCurrencyLang::CurrencyFormat($arDiscountSave['NEXT_LEVEL']['RANGE_FROM'] - $arDiscountSave['RANGE_SUMM'], $arDiscountSave['CURRENCY'], true)), GetMessage('BX_CMP_CDI_TPL_MESS_NEXT_LEVEL'));
}
?>
</p><br /><?php
}
}
示例13: CurrencyFormatNumber
function CurrencyFormatNumber($price, $currency)
{
return CCurrencyLang::CurrencyFormat($price, $currency, false);
}
示例14:
" onclick="loadGraphData()" id="stats_loading_button" name="template_preview"><span id="stats_wait" class="loading-message-text" style="display: none; margin-top: 5px;"><?php
echo Loc::getMessage('SEO_YANDEX_STATS_WAIT');
?>
</span>
</td>
</tr>
<?php
if ($bSale) {
?>
<tr>
<td><?php
echo Loc::getMessage('SEO_YANDEX_STATS_SUM_ORDER_REPIOD');
?>
:</td>
<td><span id="banner_profit"><?php
echo \CCurrencyLang::CurrencyFormat(doubleval($bannerProfit), \Bitrix\Currency\CurrencyManager::getBaseCurrency(), true);
?>
</span></td>
</tr>
<?php
}
?>
<tr>
<td><?php
echo Loc::getMessage('SEO_YANDEX_STATS_GRAPH_TYPE');
?>
:</td>
<td><select onchange="setGraph(this.value)">
<option value="sum"><?php
echo Loc::getMessage('SEO_YANDEX_STATS_GRAPH_TYPE_SUM');
?>
示例15: getProducts
private function getProducts()
{
if (!($arFilter = $this->getUserFilter())) {
return array();
}
if ($this->arParams['SHOW_NOTAVAIL'] == 'N') {
$arFilter['CAN_BUY'] = 'Y';
}
if ($this->arParams['SHOW_DELAY'] == 'N') {
$arFilter['DELAY'] = 'N';
}
if ($this->arParams['SHOW_SUBSCRIBE'] == 'N') {
$arFilter["SUBSCRIBE"] = 'N';
}
$dbItems = CSaleBasket::GetList(array("NAME" => "ASC", "ID" => "ASC"), $arFilter, false, false, array("ID", "NAME", "CALLBACK_FUNC", "MODULE", "PRODUCT_ID", "QUANTITY", "DELAY", "CAN_BUY", "PRICE", "WEIGHT", "DETAIL_PAGE_URL", "CURRENCY", "VAT_RATE", "CATALOG_XML_ID", "MEASURE_NAME", "PRODUCT_XML_ID", "SUBSCRIBE", "DISCOUNT_PRICE", "PRODUCT_PROVIDER_CLASS", "TYPE", "SET_PARENT_ID"));
$arBasketItems = array();
$arElementId = array();
$arSku2Parent = array();
while ($arItem = $dbItems->GetNext(true, false)) {
if (CSaleBasketHelper::isSetItem($arItem)) {
continue;
}
$arItem["PRICE_FMT"] = CCurrencyLang::CurrencyFormat($arItem["PRICE"], $arItem["CURRENCY"], true);
$arItem["FULL_PRICE"] = CCurrencyLang::CurrencyFormat($arItem["PRICE"] + $arItem["DISCOUNT_PRICE"], $arItem["CURRENCY"], true);
$arItem['QUANTITY'] += 0;
// remove excessive zeros after period
if (!$arItem['MEASURE_NAME']) {
$arItem['MEASURE_NAME'] = GetMessage('TSB1_MEASURE_NAME');
}
if ($this->arParams['SHOW_IMAGE'] == 'Y' && $this->bUseCatalog && $arItem["MODULE"] == 'catalog') {
$arElementId[] = $arItem["PRODUCT_ID"];
$arParent = CCatalogSku::GetProductInfo($arItem["PRODUCT_ID"]);
if ($arParent) {
$arElementId[] = $arParent["ID"];
$arSku2Parent[$arItem["PRODUCT_ID"]] = $arParent["ID"];
}
}
$arBasketItems[] = $arItem;
}
$arResult = array('CATEGORIES' => array(), 'TOTAL_PRICE' => 0);
if ($arBasketItems) {
if ($this->arParams['SHOW_IMAGE'] == 'Y') {
$this->setImgSrc($arBasketItems, $arElementId, $arSku2Parent);
}
$arResult["CATEGORIES"] = array("READY" => array(), "DELAY" => array(), "SUBSCRIBE" => array(), "NOTAVAIL" => array());
// fill item arrays for templates
foreach ($arBasketItems as $arItem) {
if ($arItem["CAN_BUY"] == "Y") {
if ($arItem["DELAY"] == "Y") {
$arResult["CATEGORIES"]["DELAY"][] = $arItem;
} else {
$arResult["CATEGORIES"]["READY"][] = $arItem;
}
} else {
if ($arItem["SUBSCRIBE"] == "Y") {
$arResult["CATEGORIES"]["SUBSCRIBE"][] = $arItem;
} else {
$arResult["CATEGORIES"]["NOTAVAIL"][] = $arItem;
}
}
}
if ($this->arParams['SHOW_PRICE'] == 'Y' || $this->arParams['SHOW_SUMMARY'] == 'Y' || $this->arParams['SHOW_TOTAL_PRICE'] == 'Y') {
$arOrder = $this->calculateOrder($arResult["CATEGORIES"]["READY"]);
$arResult["CATEGORIES"]["READY"] = $arOrder['BASKET_ITEMS'];
foreach ($arResult["CATEGORIES"]["READY"] as &$arItem) {
$arItem["SUM"] = CCurrencyLang::CurrencyFormat($arItem["PRICE"] * $arItem["QUANTITY"], $arItem["CURRENCY"], true);
$arItem["PRICE_FMT"] = CCurrencyLang::CurrencyFormat($arItem["PRICE"], $arItem["CURRENCY"], true);
}
$arResult["TOTAL_PRICE"] = $arOrder['ORDER_PRICE'];
}
}
return array('NUM_PRODUCTS' => count($arBasketItems), 'TOTAL_PRICE' => $arResult["TOTAL_PRICE"], 'CATEGORIES' => $arResult["CATEGORIES"]);
}