src/Encoder/FloatEncoder.php
private function formatFloat($float, $digits)
    {
        $digits = max((int) $digits, 1);
        $string = rtrim(number_format($float, $digits, '.', ''), '0');

        return substr($string, -1) === '.' ? $string . '0' : $string;
    }
private function formatFloat($float, $digits)
    {
        $digits = max((int) $digits, 1);
        $string = rtrim(number_format($float, $digits, '.', ''), '0');

        return substr($string, -1) === '.' ? $string . '0' : $string;
    }
private function formatFloat ( $ float , $ digits ) { $ digits = max ( ( int ) $ digits , 1 ) ; $ string = rtrim ( number_format ( $ float , $ digits , '.' , '' ) , '0' ) ; return substr ( $ string , - 1 ) === '.' ? $ string . '0' : $ string ; }
Formats the number as a decimal number.
@param float $float The number to format
@param int $digits The maximum number of decimal digits
@return string The number formatted as a decimal number
Formats the number as a decimal number .