private static function formatFloat($f, $precision)
    {
        $scale = pow(10, max(0, $precision));
        // clear off additional digits so that number_format doesn't round numbers
        $i = (int)($f * $scale) / $scale;
        return number_format($i, $precision, '.', '');
    }
private static function formatFloat($f, $precision)
    {
        $scale = pow(10, max(0, $precision));
        // clear off additional digits so that number_format doesn't round numbers
        $i = (int)($f * $scale) / $scale;
        return number_format($i, $precision, '.', '');
    }
private static function formatFloat ( $ f , $ precision ) { $ scale = pow ( 10 , max ( 0 , $ precision ) ) ; // clear off additional digits so that number_format doesn't round numbers $ i = ( int ) ( $ f * $ scale ) / $ scale ; return number_format ( $ i , $ precision , '.' , '' ) ; }
Format a float to string
@param float $f the number to format as string
@param int $precision desired precision
@return string
Format a float to string