Flow\Helper::number_format PHP Method

number_format() public static method

public static number_format ( $obj = null, $decimals, $dec_point = '.', $thousands_sep = ',' )
    public static function number_format($obj = null, $decimals = 0, $dec_point = '.', $thousands_sep = ',')
    {
        return number_format(strval($obj), $decimals, $dec_point, $thousands_sep);
    }

Usage Example

Beispiel #1
0
 public function test_number_format()
 {
     $this->assertEquals('12,059', Helper::number_format(12059.34));
     $this->assertEquals('12,059.34', Helper::number_format(12059.34, 2));
     $this->assertEquals('12.059,34', Helper::number_format(12059.34, 2, ',', '.'));
 }