Filter
rpress_currency_value_type
On this page
Filters the configured currency value type.
Runs in rpress_get_currency_value_type. The value is read from the currency_value_type setting and normalised to either float or round. When the value is round, display decimals are forced to zero by rpress_get_currency_display_decimals.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$value_type | string | Either 'float' or 'round'. |
Return value#
string. The currency value type, 'float' or 'round'.
Example#
function my_currency_value_type( $value_type ) {
return 'round' === $value_type ? 'round' : 'float';
}
add_filter( 'rpress_currency_value_type', 'my_currency_value_type', 10, 1 );
Notes#
Other values returned from this filter are not validated afterwards.
Source#
Applied in:
includes/formatting.php(line 77), inrpress_get_currency_value_type()
See also#
Was this page helpful?
