private function format_float($value) {
        if (is_numeric($value)) {
            if ($value > 0) {
                $decimals = strlen($value) - strlen(floor($value)) - 1;
            } else {
                $decimals = strlen($value) - strlen(ceil($value)) - 1;
            }
            $value = format_float($value, $decimals);
        }
        return $value;
    }
private function format_float($value) {
        if (is_numeric($value)) {
            if ($value > 0) {
                $decimals = strlen($value) - strlen(floor($value)) - 1;
            } else {
                $decimals = strlen($value) - strlen(ceil($value)) - 1;
            }
            $value = format_float($value, $decimals);
        }
        return $value;
    }
private function format_float ( $ value ) { if ( is_numeric ( $ value ) ) { if ( $ value > 0 ) { $ decimals = strlen ( $ value ) - strlen ( floor ( $ value ) ) - 1 ; } else { $ decimals = strlen ( $ value ) - strlen ( ceil ( $ value ) ) - 1 ; } $ value = format_float ( $ value , $ decimals ) ; } return $ value ; }
Given a float, prints it nicely.
This function reserves the number of decimal places.

@param float|null $value The float number to format
@return string Localised float
Given a float prints it nicely . This function reserves the number of decimal places .