bbp_number_format( string $number, string $decimals = false, $dec_point = '.', $thousands_sep = ',' )
A Forums specific method of formatting numeric values
Description
Parameters
- $number
-
(Required) Number to format
- $decimals
-
(Optional) Display decimals
Default value: false
Return
(string) Formatted string
Source
File: bp-forums/common/functions.php
function bbp_number_format( $number = 0, $decimals = false, $dec_point = '.', $thousands_sep = ',' ) { // If empty, set $number to (int) 0 if ( ! is_numeric( $number ) ) $number = 0; return apply_filters( 'bbp_number_format', number_format( $number, $decimals, $dec_point, $thousands_sep ), $number, $decimals, $dec_point, $thousands_sep ); }
Changelog
Version | Description |
---|---|
bbPress (r2486) | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.