Price
class Price (View source)
Methods
void
__get(string $name)
Getter for methods/properties.
string
__toString()
Cast class as a string.
float
decimal($rounding = true)
Get the decimal value.
float
unitDecimal($rounding = true)
Get the decimal unit value.
string
formatted($locale = null, $formatterStyle = NumberFormatter::CURRENCY, $decimalPlaces = null, $trimTrailingZeros = true)
Format the value with the currency.
string
unitFormatted($locale = null, $formatterStyle = NumberFormatter::CURRENCY, $decimalPlaces = null, $trimTrailingZeros = true)
Format the unit value with the currency.
formatValue($value, $locale = null, $formatterStyle = NumberFormatter::CURRENCY, $decimalPlaces = null, $trimTrailingZeros = true)
No description
Details
__construct(mixed $value, Currency $currency, int $unitQty = 1)
Initialise the Price datatype.
void
__get(string $name)
Getter for methods/properties.
string
__toString()
Cast class as a string.
float
decimal($rounding = true)
Get the decimal value.
float
unitDecimal($rounding = true)
Get the decimal unit value.
string
formatted($locale = null, $formatterStyle = NumberFormatter::CURRENCY, $decimalPlaces = null, $trimTrailingZeros = true)
Format the value with the currency.
string
unitFormatted($locale = null, $formatterStyle = NumberFormatter::CURRENCY, $decimalPlaces = null, $trimTrailingZeros = true)
Format the unit value with the currency.
protected
formatValue($value, $locale = null, $formatterStyle = NumberFormatter::CURRENCY, $decimalPlaces = null, $trimTrailingZeros = true)
No description