You are here

public static function ReportConstants::countFormat in XHProf 8

Formats float numbers.

Parameters

float $num: The number.

Return value

string The formatted number.

File

src/XHProfLib/Report/ReportConstants.php, line 172

Class

ReportConstants
Provides helpers for string constants.

Namespace

Drupal\xhprof\XHProfLib\Report

Code

public static function countFormat($num) {
  $num = round($num, 3);
  if (round($num) == $num) {
    return number_format($num);
  }
  return number_format($num, 3);
}