Documentation

BX.Currency.setCurrencyFormat

BX.Currency.setCurrencyFormat(
currency, format, replace
);

This function sets a specific currency format.

Function parameters

Parameter Description Type
currency Currency ID. string
format Format description. object
replace Replace format, when the format already specified. bool

Returned value

None.

Examples:

<? 
CJSCore::Init(array('currency')); 
 
$currencyFormat = CCurrencyLang::GetFormatDescription('USD'); 
?> 
<script type="text/javascript"> 
BX.Currency.setCurrencyFormat('RUB', <? echo CUtil::PhpToJSObject($currencyFormat, false, true); ?>);  
var formatRub = BX.Currency.currencyFormat(121.50, 'USD', true);  
alert(formatRub); 
</script>



© «Bitrix24», 2001-2022
Up