bbp_number_format_i18n

A bbPress specific method of formatting numeric values.

Description

(string) bbp_number_format_i18n( (int) $number = 0, (bool) $decimals = false ); 

Returns (string)

Formatted string

Parameters (2)

0. $number — Optional. (int)
Number to format
1. $decimals — Optional. (bool) => false
Display decimals

Usage

  1. if ( !function_exists( 'bbp_number_format_i18n' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/common/functions.php'; 
  3.  
  4. // Number to format 
  5. $number = -1; 
  6.  
  7. // Optional. Display decimals 
  8. $decimals = false; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bbp_number_format_i18n($number, $decimals); 
  12.  

Defined (1)

The function is defined in the following location(s).

/includes/common/functions.php  
  1. function bbp_number_format_i18n( $number = 0, $decimals = false ) { 
  2.  
  3. // If empty, set $number to (int) 0 
  4. if ( ! is_numeric( $number ) ) 
  5. $number = 0; 
  6.  
  7. return apply_filters( 'bbp_number_format_i18n', number_format_i18n( $number, $decimals ), $number, $decimals );