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

        return substr($string, -1) === '.' ? $string . '0' : $string;
    }