moodle-qtype_formulas
moodle-qtype_formulas copied to clipboard
Formatted output of numbers, e.g. with scientific notation
Description of proposed feature
It would be very helpful to have a function that allows for formatted output of numbers (e.g. in the feedback fields), especially in scientific notation.
How can the new feature be used?
I only give examples of possible function names, but the could, of course, also be totally different.
A function str_scinot(1234) (think "scientific notation") would return the string 1.234e3.
A function str_mant(1234) (think "mantissa") would return the string 1.234.
A function str_ordmag(1234) (think "order of magnitude") would return the string 3.
Additional comments
Let me know if it would be helpful at all if I created code snippets for these functions as in https://github.com/FormulasQuestion/moodle-qtype_formulas/issues/61