gl_get_number_format

Function convert number to short value with M, B, k.

Description

gl_get_number_format( $value ); 

Parameters (1)

0. $value
The value.

Usage

  1. if ( !function_exists( 'gl_get_number_format' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-locker-for-wordpress/admin/shortcode.php'; 
  3.  
  4. // The value. 
  5. $value = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = gl_get_number_format($value); 
  9.  

Defined (1)

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

/admin/shortcode.php  
  1. function gl_get_number_format($value) { 
  2. if ( $value > 1000000000 ) return round( ($value/1000000000), 1 ).'B'; 
  3. else if ( $value > 1000000 ) return round( ($value/1000000), 1 ).'M'; 
  4. else if ( $value > 1000 ) return round( ($value/1000), 1 ).'k'; 
  5.  
  6. return $value;