Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 514... Línea 514...
514
     *
514
     *
515
     * @param string|null $min The minimum value in the range
515
     * @param string|null $min The minimum value in the range
516
     * @param string|null $max The maximum value in the range
516
     * @param string|null $max The maximum value in the range
517
     * @return string
517
     * @return string
518
     */
518
     */
519
    protected function format_range(string $min = null, string $max = null) {
519
    protected function format_range(?string $min = null, ?string $max = null) {
520
        if (is_null($min) && is_null($max)) {
520
        if (is_null($min) && is_null($max)) {
521
            return '';
521
            return '';
522
        } else {
522
        } else {
523
            $a = new stdClass();
523
            $a = new stdClass();
524
            $a->min = $min;
524
            $a->min = $min;
Línea 550... Línea 550...
550
     * @param float|null $max The maximum value of the range
550
     * @param float|null $max The maximum value of the range
551
     * @param bool $fraction An indicator for whether min and max are a fractions or are already multiplied by 100
551
     * @param bool $fraction An indicator for whether min and max are a fractions or are already multiplied by 100
552
     * @param int $decimals Sets the number of decimal points
552
     * @param int $decimals Sets the number of decimal points
553
     * @return string A formatted string that represents a range between $min to $max.
553
     * @return string A formatted string that represents a range between $min to $max.
554
     */
554
     */
555
    protected function format_percentage_range(float $min = null, float $max = null, bool $fraction = true, int $decimals = 2) {
555
    protected function format_percentage_range(?float $min = null, ?float $max = null, bool $fraction = true, int $decimals = 2) {
556
        if (is_null($min) && is_null($max)) {
556
        if (is_null($min) && is_null($max)) {
557
            return '';
557
            return '';
558
        } else {
558
        } else {
559
            $min = $min ?: 0;
559
            $min = $min ?: 0;
560
            $max = $max ?: 0;
560
            $max = $max ?: 0;