PHP Class Lavoiesl\PhpBenchmark\Util

Show file Open project: lavoiesl/php-benchmark

Public Methods

Method Description
convertToSI ( double $number, integer $precision = 2, string $unit = 'B', integer $factor = 1024 ) : string Converts 1024 to 1K, etc.
relativePerc ( $min, $value )
round ( $number, $significant )

Method Details

convertToSI() public static method

Converts 1024 to 1K, etc.
public static convertToSI ( double $number, integer $precision = 2, string $unit = 'B', integer $factor = 1024 ) : string
$number double i.e.: 1280
$precision integer i.e.: 1.25 for precision = 2
$unit string suffix of the unit, may be empty
$factor integer change base to 1000 or 1024
return string i.e.: 1.25 kB

relativePerc() public static method

public static relativePerc ( $min, $value )

round() public static method

public static round ( $number, $significant )