mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 01:16:44 +02:00
MDL-71258 questions: privacy support for settings defaults preferences
This commit is contained in:
parent
5b315fa595
commit
d25f0453cf
28 changed files with 1587 additions and 72 deletions
|
@ -80,4 +80,18 @@ class transform {
|
|||
return get_string('no');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Translate a float value which should be between 0.0 and 1.0 into percentage.
|
||||
*
|
||||
* @param float $value The value between 0.0 and 1.0.
|
||||
* @return float|string
|
||||
*/
|
||||
public static function percentage(float $value) {
|
||||
if (is_float($value)) {
|
||||
return (100 * $value) . '%';
|
||||
} else {
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue