[gcalctool] Don't use automatic exponential format when not in base 10
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcalctool] Don't use automatic exponential format when not in base 10
- Date: Fri, 18 Mar 2011 03:47:11 +0000 (UTC)
commit 6fb01c44c153f15c9ee40bf078d3cef3800a86cb
Author: Robert Ancell <robert ancell canonical com>
Date: Fri Mar 18 14:45:09 2011 +1100
Don't use automatic exponential format when not in base 10
NEWS | 1 +
src/mp-serializer.c | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/NEWS b/NEWS
index 2d30ea1..3f93710 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ Overview of changes in gcalctool 5.91.91
* Disable localized digits (Bug #644980)
* Fix crash doing bitwise operations with large numbers (Bug #637328)
+ * Don't use automatic exponential format when not in base 10
Overview of changes in gcalctool 5.91.90
diff --git a/src/mp-serializer.c b/src/mp-serializer.c
index 9d877d6..e3af219 100644
--- a/src/mp-serializer.c
+++ b/src/mp-serializer.c
@@ -360,7 +360,7 @@ mp_serializer_to_string(MpSerializer *serializer, const MPNumber *x)
case MP_DISPLAY_FORMAT_AUTOMATIC:
s0 = mp_cast_to_string(serializer, x);
s1 = mp_cast_to_exponential_string(serializer, x, FALSE);
- if (g_utf8_strlen(s0, -1) < g_utf8_strlen(s1, -1))
+ if (serializer->priv->base != 10 || g_utf8_strlen(s0, -1) < g_utf8_strlen(s1, -1))
{
g_free(s1);
return s0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]