Example #1
0
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));
}
Example #2
0
        ?>
"></a>
										<a class="bx_ui_slider_handle right" style="right:0;" href="javascript:void(0)" id="right_slider_<?php 
        echo $key;
        ?>
"></a>
									</div>
								</div>
								<div style="opacity: 0;height: 1px;"></div>
							</div>
						</div>
					</div>
					<?php 
        $precision = 2;
        if (Bitrix\Main\Loader::includeModule("currency")) {
            $res = CCurrencyLang::GetFormatDescription($arItem["VALUES"]["MIN"]["CURRENCY"]);
            $precision = $res['DECIMALS'];
        }
        $arJsParams = array("leftSlider" => 'left_slider_' . $key, "rightSlider" => 'right_slider_' . $key, "tracker" => "drag_tracker_" . $key, "trackerWrap" => "drag_track_" . $key, "minInputId" => $arItem["VALUES"]["MIN"]["CONTROL_ID"], "maxInputId" => $arItem["VALUES"]["MAX"]["CONTROL_ID"], "minPrice" => $arItem["VALUES"]["MIN"]["VALUE"], "maxPrice" => $arItem["VALUES"]["MAX"]["VALUE"], "curMinPrice" => $arItem["VALUES"]["MIN"]["HTML_VALUE"], "curMaxPrice" => $arItem["VALUES"]["MAX"]["HTML_VALUE"], "fltMinPrice" => intval($arItem["VALUES"]["MIN"]["FILTERED_VALUE"]) ? $arItem["VALUES"]["MIN"]["FILTERED_VALUE"] : $arItem["VALUES"]["MIN"]["VALUE"], "fltMaxPrice" => intval($arItem["VALUES"]["MAX"]["FILTERED_VALUE"]) ? $arItem["VALUES"]["MAX"]["FILTERED_VALUE"] : $arItem["VALUES"]["MAX"]["VALUE"], "precision" => $precision, "colorUnavailableActive" => 'colorUnavailableActive_' . $key, "colorAvailableActive" => 'colorAvailableActive_' . $key, "colorAvailableInactive" => 'colorAvailableInactive_' . $key);
        ?>
					<script type="text/javascript">
						BX.ready(function(){
							window['trackBar<?php 
        echo $key;
        ?>
'] = new BX.Iblock.SmartFilter(<?php 
        echo CUtil::PhpToJSObject($arJsParams);
        ?>
);
						});
					</script>
Example #3
0
						'DECIMALS' => $currencyFormat['DECIMALS'],
						'THOUSANDS_VARIANT' => $currencyFormat['THOUSANDS_VARIANT'],
						'HIDE_ZERO' => $currencyFormat['HIDE_ZERO']
					)
				)
			);
			unset($currencyFormat);
		}
		else
		{
			$currencyIterator = CurrencyTable::getList(array(
				'select' => array('CURRENCY')
			));
			while ($currency = $currencyIterator->fetch())
			{
				$currencyFormat = CCurrencyLang::GetFormatDescription($currency['CURRENCY']);
				$arResult['CURRENCIES'][] = array(
					'CURRENCY' => $currency['CURRENCY'],
					'FORMAT' => array(
						'FORMAT_STRING' => $currencyFormat['FORMAT_STRING'],
						'DEC_POINT' => $currencyFormat['DEC_POINT'],
						'THOUSANDS_SEP' => $currencyFormat['THOUSANDS_SEP'],
						'DECIMALS' => $currencyFormat['DECIMALS'],
						'THOUSANDS_VARIANT' => $currencyFormat['THOUSANDS_VARIANT'],
						'HIDE_ZERO' => $currencyFormat['HIDE_ZERO']
					)
				);
			}
			unset($currencyFormat, $currency, $currencyIterator);
		}
	}
Example #4
0
        $taggedCache = Application::getInstance()->getTaggedCache();
        if (!empty($tagIblockList)) {
            foreach ($tagIblockList as &$iblock) {
                $taggedCache->registerTag('iblock_id_' . $iblock);
            }
            unset($iblock);
        }
        if (!empty($tagCurrencyList)) {
            foreach ($tagCurrencyList as &$currency) {
                $taggedCache->registerTag('currency_id_' . $currency);
            }
            unset($currency);
        }
    }
    if ($arResult["SET_ITEMS"]["OLD_PRICE"] && $arResult["SET_ITEMS"]["OLD_PRICE"] != $arResult["SET_ITEMS"]["PRICE"]) {
        $arResult["SET_ITEMS"]["OLD_PRICE"] = CCurrencyLang::CurrencyFormat($arResult["SET_ITEMS"]["OLD_PRICE"], $defaultCurrency, true);
    } else {
        $arResult["SET_ITEMS"]["OLD_PRICE"] = 0;
    }
    if ($arResult["SET_ITEMS"]["PRICE"]) {
        $arResult["SET_ITEMS"]["PRICE"] = CCurrencyLang::CurrencyFormat($arResult["SET_ITEMS"]["PRICE"], $defaultCurrency, true);
    }
    if ($arResult["SET_ITEMS"]["PRICE_DISCOUNT_DIFFERENCE"]) {
        $arResult["SET_ITEMS"]["PRICE_DISCOUNT_DIFFERENCE"] = CCurrencyLang::CurrencyFormat($arResult["SET_ITEMS"]["PRICE_DISCOUNT_DIFFERENCE"], $defaultCurrency, true);
    }
    $currencyFormat = CCurrencyLang::GetFormatDescription($defaultCurrency);
    $arResult['CURRENCIES'] = array(array('CURRENCY' => $defaultCurrency, 'FORMAT' => array('FORMAT_STRING' => $currencyFormat['FORMAT_STRING'], 'DEC_POINT' => $currencyFormat['DEC_POINT'], 'THOUSANDS_SEP' => $currencyFormat['THOUSANDS_SEP'], 'DECIMALS' => $currencyFormat['DECIMALS'], 'THOUSANDS_VARIANT' => $currencyFormat['THOUSANDS_VARIANT'], 'HIDE_ZERO' => $currencyFormat['HIDE_ZERO'])));
    unset($currencyFormat);
    $this->SetResultCacheKeys(array());
    $this->IncludeComponentTemplate();
}
Example #5
0
 public static function GetCurrencyFormatParams($currencyID)
 {
     if (!CModule::IncludeModule('currency')) {
         return array();
     }
     return CCurrencyLang::GetFormatDescription($currencyID);
 }