You are here

function bigint_number_format in Big Integer 7

1 call to bigint_number_format()
bigint_field_formatter_view in ./bigint.module
Implements hook_field_formatter_view().

File

./bigint.module, line 212
Defines numeric field types.

Code

function bigint_number_format($number, $sep2 = '') {

  //The number_format() function in PHP cannot handle large numbers.  An example is: 1234567890123456789 would get formated to:  1,234,567,890,123,456,768

  //which is obviously incorrect.  This function replaces the number_format() function with something that actually works.
  return preg_replace("/(?<=\\d)(?=(\\d{3})+(?!\\d))/", $sep2, $number);
}