formatPrice() public static method

public static formatPrice ( integer $price, string $currency, string $context, string $languageCode = null ) : string
$price integer Price in cents
$currency string Three letter currency code
$context string
$languageCode string
return string
Beispiel #1
0
/**
 * Get formatted currency string. If you don't like the way the price is formatted by default, catch ipFormatPrice job and provide your own formatting method.
 *
 * @param int $price Numeric price. Multiplied by 100.
 * @param string $currency Three letter currency code. E.g. "EUR".
 * @param string $context Plugins name that's requesting the operation. This makes it possible to render the price differently for each plugin.
 * @param string $languageCode
 * @return string A currency string in specific country format.
 */
function ipFormatPrice($price, $currency, $context, $languageCode = null)
{
    return \Ip\Internal\FormatHelper::formatPrice($price, $currency, $context, $languageCode);
}