Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
mod_lesson\local\numeric\helper Class Reference

Lesson numeric page helper. More...

Static Public Member Functions

static lesson_format_numeric_value ($value)
 Helper function to format a given value into locale specific values with n:n signifying ranges.
 
static lesson_unformat_numeric_value (string $value)
 Helper function to unformat a given numeric value from locale specific values with n:n signifying ranges to standards with decimal point numbers/ranges.
 

Detailed Description

Lesson numeric page helper.

Member Function Documentation

◆ lesson_format_numeric_value()

static mod_lesson\local\numeric\helper::lesson_format_numeric_value ( $value)
static

Helper function to format a given value into locale specific values with n:n signifying ranges.

Parameters
string | number$valueThe value to be formatted
Return values
string\$formattedvalueFormatted value OR $value if not numeric

◆ lesson_unformat_numeric_value()

static mod_lesson\local\numeric\helper::lesson_unformat_numeric_value ( string $value)
static

Helper function to unformat a given numeric value from locale specific values with n:n signifying ranges to standards with decimal point numbers/ranges.

Parameters
string$valueThe value to be formatted
Return values
string|float|bool\$formattedvalueunformatted value String - If it is a range it will return a value e.g. 2:4 Float - if it's a properly formatted float Null - If empty and could not be converted

The documentation for this class was generated from the following file: