Convert mathjs objects to strings in evaluations

This commit is contained in:
Thaum Rystra
2020-05-28 20:10:33 +02:00
parent 7f2401da81
commit 44e726417e

View File

@@ -32,6 +32,7 @@ export default function evaluateCalculation(string, memo){
// Evaluate the expression to a number or return with substitutions
try {
let value = substitutedCalc.evaluate(memo.statsByVariableName);
if (typeof value === 'object') value = value.toString();
return {errors, value};
} catch (e){
errors.push({