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( $bypass_cache=false )

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

Parameters​

NameTypeDefaultDescription
$bypass_cacheboolfalseIf true, the cache will not be used.

Returns​

  • array

Throws​

  • Throwable

Since:

  • unknown.
  • 2.5.13 (add currency code to the configuration array.)
  • 3.0.3 (Added static caching and the $bypass_cache param.)

Source: currency.php:154

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[]

Throws​

  • Throwable

Since: 2.7

Source: currency.php:451