summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormbkma <[email protected]>2021-02-02 09:46:51 +0100
committerRobert Antoni Buj Gelonch <[email protected]>2021-02-18 07:37:47 +0100
commitd40a7e81e6354cc7c4fb87c047c1a747a7edbd00 (patch)
tree6a24bcb3a2dd4accf271ae4735d17489bc3c2f5e
parent74ede8b3bcd79bd9157641b9ffaebc9fb4e5c293 (diff)
downloadmate-calc-d40a7e81e6354cc7c4fb87c047c1a747a7edbd00.tar.bz2
mate-calc-d40a7e81e6354cc7c4fb87c047c1a747a7edbd00.tar.xz
factorization: display prime factors in fixed number format
-rw-r--r--src/math-equation.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/math-equation.c b/src/math-equation.c
index 8f8c1c1..6a0a37a 100644
--- a/src/math-equation.c
+++ b/src/math-equation.c
@@ -1375,7 +1375,9 @@ math_equation_factorize_real(gpointer data)
MPNumber x = mp_new();
MathEquation *equation = MATH_EQUATION(data);
SolveData *result = g_slice_new0(SolveData);
+ MpDisplayFormat format = mp_serializer_get_number_format(equation->priv->serializer);
+ mp_serializer_set_number_format(equation->priv->serializer, MP_DISPLAY_FORMAT_FIXED);
math_equation_get_number(equation, &x);
factors = mp_factorize(&x);
@@ -1418,6 +1420,8 @@ math_equation_factorize_real(gpointer data)
g_string_free(text, TRUE);
mp_clear(&x);
+ mp_serializer_set_number_format(equation->priv->serializer, format);
+
return NULL;
}