Skip to content

MoneyHelper ​

Type
Class
Namespace
craft\helpers
Inherits
craft\helpers\MoneyHelper
Since
4.0.0

Class MoneyHelper

View source

Public Methods ​

MethodDescription
normalizeString()
toDecimal()Convert money object to standard decimal string.
toMoney()
toNumber()Convert money object to localized decimal string.
toString()Convert money object to localized currency string.

normalizeString() ​

Since
5.2.9

View source

Arguments ​

  • $value (string)
  • $fallbackCurrency (\Money\Currency, null)

Returns ​

string

toDecimal() ​

Convert money object to standard decimal string.

View source

Arguments ​

  • $value (mixed)

Returns ​

string, false

toMoney() ​

View source

Arguments ​

  • $value (mixed)

Returns ​

\Money\Money, false

toNumber() ​

Convert money object to localized decimal string.

View source

Arguments ​

Returns ​

string, false

toString() ​

Convert money object to localized currency string.

View source

Arguments ​

Returns ​

string, false