From 686dc77e78eddfc827e652ff7dbb4520e8d853f8 Mon Sep 17 00:00:00 2001 From: Jonatan Heyman Date: Thu, 2 Mar 2023 21:00:00 +0100 Subject: [PATCH] Increase number of digits needed before shortening numbers such as 3.7e+9 --- src/editor/block/math.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/editor/block/math.js b/src/editor/block/math.js index c377989..74dd426 100644 --- a/src/editor/block/math.js +++ b/src/editor/block/math.js @@ -49,7 +49,11 @@ function mathDeco(view) { // if we got a result from math.js, add the result decoration if (result !== undefined) { - builder.add(line.to, line.to, Decoration.widget({widget: new MathResult(math.format(result, 8)), side: 1})) + builder.add(line.to, line.to, Decoration.widget({widget: new MathResult(math.format(result, { + precision: 8, + upperExp: 8, + lowerExp: -6, + })), side: 1})) } } pos = line.to + 1