Skip to content
Docs
Get RestroPress

Filter

rpress_format_amount

Updated
On this page

Filters the formatted amount returned by rpress_format_amount.

Runs at the end of rpress_format_amount, after number_format has applied the decimals and the thousands and decimal separators from the settings. The result does not include a currency symbol.

Parameters#

ParameterTypeDescription
$formattedstringThe formatted amount.
$amountstringThe sanitized amount before formatting.
$decimalsintNumber of decimals used.
$decimal_sepstringDecimal separator.
$thousands_sepstringThousands separator.

Return value#

string. The formatted amount.

Example#

function my_format_amount( $formatted, $amount, $decimals, $decimal_sep, $thousands_sep ) {
	return $formatted;
}
add_filter( 'rpress_format_amount', 'my_format_amount', 10, 5 );

Source#

Applied in:

  • includes/formatting.php (line 142), in rpress_format_amount()

See also#

Was this page helpful?