Currency
extends PlatformUtility
in package
Provides access to currency utility functions.
Tags
Table of Contents
- format() : string
- Format a currency using the currency and locale for the current session.
- formatOrder() : string
- Format a currency using the currency and the order id
- formatPriceEnglish() : float
- Format a price value to a unified format with 2 decimal places and a dot as decimal separator.
- getAlphabeticCode() : string
- Get the alphabetic currency code for the current session.
- getDisplayWithVat() : bool
- Get the setting for display with vat
- getNumericCode() : string
- Get the numeric currency code for the current session.
- getSettings() : stdClass
Methods
format()
Format a currency using the currency and locale for the current session.
public
format(float $number[, bool $format = false ][, string $symbol = null ][, int $symbolPlace = null ][, int $decimalCount = null ][, string $decimal = null ][, string $point = null ]) :
string
Parameters
- $number : float
- $format : bool = false
- $symbol : string = null
- $symbolPlace : int = null
- $decimalCount : int = null
- $decimal : string = null
- $point : string = null
Tags
Return values
string —formatOrder()
Format a currency using the currency and the order id
public
formatOrder(float $number, int $orderId) :
string
Parameters
- $number : float
- $orderId : int
Tags
Return values
string —formatPriceEnglish()
Format a price value to a unified format with 2 decimal places and a dot as decimal separator.
public
formatPriceEnglish(float $value) :
float
Parameters
- $value : float
Tags
Return values
float —getAlphabeticCode()
Get the alphabetic currency code for the current session.
public
getAlphabeticCode() :
string
Tags
Return values
string —getDisplayWithVat()
Get the setting for display with vat
public
getDisplayWithVat() :
bool
Tags
Return values
bool —getNumericCode()
Get the numeric currency code for the current session.
public
getNumericCode() :
string
Tags
Return values
string —getSettings()
public
getSettings() : stdClass