Filter
rpress_currency_display_decimals
On this page
Filters the number of decimal places used to display currency values.
Runs in rpress_get_currency_display_decimals after the decimals are cast to an absolute integer and set to 0 when the currency value type is round. It is called from rpress_format_amount.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$decimals | int | Number of display decimals. |
Return value#
int. The number of display decimals.
Example#
function my_currency_display_decimals( $decimals ) {
return 'JPY' === rpress_get_currency() ? 0 : $decimals;
}
add_filter( 'rpress_currency_display_decimals', 'my_currency_display_decimals', 10, 1 );
Source#
Applied in:
includes/formatting.php(line 94), inrpress_get_currency_display_decimals()
See also#
Was this page helpful?
