public static function roundFixed($value, $decimals = 2)
    {
        $value = round($value, $decimals);

        $pos = strpos($value, '.');

        if ($pos === false) {
            $value .= '.' . str_repeat('0', $decimals);
        } else {
            $extra = $decimals - strlen($value) + $pos + 1;
            if ($extra > 0) {
                $value .= str_repeat('0', $extra);
            }
        }

        return $value;
    }
public static function roundFixed($value, $decimals = 2)
    {
        $value = round($value, $decimals);

        $pos = strpos($value, '.');

        if ($pos === false) {
            $value .= '.' . str_repeat('0', $decimals);
        } else {
            $extra = $decimals - strlen($value) + $pos + 1;
            if ($extra > 0) {
                $value .= str_repeat('0', $extra);
            }
        }

        return $value;
    }
public static function roundFixed ( $ value , $ decimals = 2 ) { $ value = round ( $ value , $ decimals ) ; $ pos = strpos ( $ value , '.' ) ; if ( $ pos === false ) { $ value .= '.' . str_repeat ( '0' , $ decimals ) ; } else { $ extra = $ decimals - strlen ( $ value ) + $ pos + 1 ; if ( $ extra > 0 ) { $ value .= str_repeat ( '0' , $ extra ) ; } } return $ value ; }
Rounds the value with a fixed number of decimals, padding
zeros when required.

@param numeric $value
@param int $decimals
@return string
Rounds the value with a fixed number of decimals padding zeros when required .