Documentation

CurrencyFormat

string
CCurrencyLang::CurrencyFormat(
 float price, 
 string currency,
 bool useTemplate
);

This method formats the price according to currency settings. In case if this method is called in the administrative section, it additionally performs cleaning of format from tag and scripts. If the method is called in the public section, then the HIDE_ZERO parameter, which responds for the hiding of nonsignificant zeros in the fractional part, will be enacted. Static method.

Note: this method is used instead of CurrencyFormat and CurrencyFormatNumber functions, which are considered as outdated starting from module 14.0.0 version.

Method parameters

ParameterDescription
pricePrice (amount of money) that shall be converted.
currencyCurrency ID code.
useTemplateIf specified as true, then it operates as CurrencyFormat and the CurrencyFormat event is called. If specified as false, then operates as CurrencyFormatNumber.

Returned values

Returns a formatted string.



© «Bitrix24», 2001-2024
Up