numbas / Numbas

A completely browser-based e-assessment/e-learning system, with an emphasis on mathematics
http://www.numbas.org.uk
Apache License 2.0
197 stars 118 forks source link

When the correct answer to a mathematical expression part contains a rounded decimal which would be rendered in scientific notation, it's interpreted as an expression in e #1053

Closed christianp closed 8 months ago

christianp commented 8 months ago

e.g. a part with correct answer set to {siground(dec("1.62e+6"), 3)} ends up having the expected answer 10.4036165621, because 1.62e+6 is interpreted as an expression in e = 2.7182818285....

The problem arises when the number is substituted into the curly braces: it should be rendered in plain form, instead of scientific notation.