Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Static Public Member Functions | List of all members
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. More...
 
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. More...
 

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: