class CRM_Utils_Money

Money utilties

Properties

static $_currencySymbols

Methods

static string
format(float $amount, string $currency = NULL, string $format = NULL, bool $onlyNumber = FALSE, string $valueFormat = NULL)

Format a monetary string.

Details

at line 64
static string format(float $amount, string $currency = NULL, string $format = NULL, bool $onlyNumber = FALSE, string $valueFormat = NULL)

Format a monetary string.

Format a monetary string basing on the amount provided, ISO currency code provided and a format string consisting of:

%a - the formatted amount %C - the currency ISO code (e.g., 'USD') if provided %c - the currency symbol (e.g., '$') if available

Parameters

float $amount The monetary amount to display (1234.56).
string $currency The three-letter ISO currency code ('USD').
string $format The desired currency format.
bool $onlyNumber
string $valueFormat The desired monetary value display format (e.g. '%!i').

Return Value

string formatted monetary string