number_format_i18n
Filters the number formatted based on the locale.
Использование
add_filter( 'number_format_i18n', 'wp_kama_number_format_i18n_filter', 10, 3 ); /** * Function for `number_format_i18n` filter-hook. * * @param string $formatted Converted number in string format. * @param float $number The number to convert based on locale. * @param int $decimals Precision of the number of decimal places. * * @return string */ function wp_kama_number_format_i18n_filter( $formatted, $number, $decimals ){ // filter... return $formatted; }
- $formatted(строка)
- Converted number in string format.
- $number(float)
- The number to convert based on locale.
- $decimals(int)
- Precision of the number of decimal places.
Список изменений
С версии 2.8.0 | Введена. |
С версии 4.9.0 | The $number and $decimals parameters were added. |
Где вызывается хук
number_format_i18n
wp-includes/functions.php 439
return apply_filters( 'number_format_i18n', $formatted, $number, $decimals );