function number_format_i18n( $number, $decimals = 0 ) {}

Convert integer number to format based on the locale.


  • int $number: The number to convert based on locale.
  • int $decimals: Precision of the number of decimal places.

Return values

returns:Converted number in string format.

Defined filters

  • number_format_i18n
    apply_filters( 'number_format_i18n', $formatted )

Source code

function number_format_i18n( $number, $decimals = 0 ) {

	global $wp_locale;

	$formatted = number_format( $number, absint( $decimals ), $wp_locale->number_format['decimal_point'], $wp_locale->number_format['thousands_sep'] );

	return apply_filters( 'number_format_i18n', $formatted );



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: