Skip to main content

to_money()

public static function to_money( $number, $currency_code_or_entry='' )

Returns the given number using currency formatting.

Since:

  • unknown
  • 2.9.29 (Updated the second parameter to accept the currency code or entry object.)

Source: common.php:4190

Parameters

NameTypeDefaultDescription
$numberint | float | stringThe number to be formatted.
$currency_code_or_entrystring | array''The currency code or entry object. Optional.

Returns

  • string