Skip to main content

RGCurrency

Source: currency.php:9

Details

  • Kind: class
  • Namespace: (global)

Methods

MethodDescription
to_number()Removes currency formatting from a value.
get_currencies()Returns an array that contains all the supported currencies and their configurations.
get_grouped_currency_options()Returns a sorted data object with filterable common currencies listed first, then all currencies either listed in

Method Reference

to_number()

public function to_number( $text )

Removes currency formatting from a value.

Parameters

NameTypeDefaultDescription
$textstring | float | intThe value to be cleaned of currency formatting.

Returns

  • false | float | int

Since: unknown

Source: currency.php:29

get_currencies()

public static function get_currencies()

Returns an array that contains all the supported currencies and their configurations.

Returns

  • array

Since:

  • unknown.
  • 2.5.13 (add currency code to the configuration array.)

Source: currency.php:150

get_grouped_currency_options()

public static function get_grouped_currency_options( $placeholder=true, $sort=true )

Returns a sorted data object with filterable common currencies listed first, then all currencies either listed in

alphabetical or original order as found in self::get_currencies() above. Designed to drive a select in a format that select2 and our react select component understands.

Parameters

NameTypeDefaultDescription
$placeholdertrue
$sorttrue

Returns

  • array | array[]

Since: 2.7

Source: currency.php:421