protected function format_percentage(float $number, bool $fraction = true, int $decimals = 2) {
        $coefficient = $fraction ? 100 : 1;
        return get_string('percents', 'moodle', format_float($number * $coefficient, $decimals));
    }
protected function format_percentage(float $number, bool $fraction = true, int $decimals = 2) {
        $coefficient = $fraction ? 100 : 1;
        return get_string('percents', 'moodle', format_float($number * $coefficient, $decimals));
    }
protected function format_percentage ( float $ number , bool $ fraction = true , int $ decimals = 2 ) { $ coefficient = $ fraction ? 100 : 1 ; return get_string ( 'percents' , 'moodle' , format_float ( $ number * $ coefficient , $ decimals ) ) ; }
Format a number to a localised percentage with specified decimal points.

@param float $number The number being formatted
@param bool $fraction An indicator for whether the number is a fraction or is already multiplied by 100
@param int $decimals Sets the number of decimal points
@return string
Format a number to a localised percentage with specified decimal points .