Skip to main content

to_number()

public static function to_number( $text, $currency_code_or_entry='' )

Removes currency formatting from a value.

Since:

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

Source: common.php:4213

Parameters

NameTypeDefaultDescription
$textint | float | stringThe value to be cleaned of currency formatting.
$currency_code_or_entrystring | array''The currency code or entry object. Optional.

Returns

  • false | float | int