[gcalctool/gnome-3-0] Fix thousands separator being on front of three digit numbers
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcalctool/gnome-3-0] Fix thousands separator being on front of three digit numbers
- Date: Thu, 21 Apr 2011 07:59:57 +0000 (UTC)
commit 3673d2142c8d883573589d682b9c60572e536e55
Author: Robert Ancell <robert ancell canonical com>
Date: Thu Apr 21 17:59:40 2011 +1000
Fix thousands separator being on front of three digit numbers
NEWS | 1 +
src/mp-serializer.c | 12 ++++++------
2 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/NEWS b/NEWS
index 32af3e1..7691be2 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,7 @@ Overview of changes in gcalctool 6.0.1
* Fix 0^n generating error for fractional n (Bug #634066)
* Fix order of implied multiplication
* Make automatic exponentiation less aggressive
+ * Fix thousands separator being on front of three digit numbers
Overview of changes in gcalctool 6.0.0
diff --git a/src/mp-serializer.c b/src/mp-serializer.c
index 501128a..4827432 100644
--- a/src/mp-serializer.c
+++ b/src/mp-serializer.c
@@ -88,6 +88,12 @@ mp_cast_to_string_real(MpSerializer *serializer, const MPNumber *x, int base, gb
MPNumber t, t2, t3;
int64_t d;
+ if (serializer->priv->base == 10 && serializer->priv->show_tsep && i == serializer->priv->tsep_count) {
+ g_string_prepend_unichar(string, serializer->priv->tsep);
+ i = 0;
+ }
+ i++;
+
mp_divide_integer(&temp, base, &t);
mp_floor(&t, &t);
mp_multiply_integer(&t, base, &t2);
@@ -98,12 +104,6 @@ mp_cast_to_string_real(MpSerializer *serializer, const MPNumber *x, int base, gb
g_string_prepend_c(string, d < 16 ? digits[d] : '?');
(*n_digits)++;
- i++;
- if (serializer->priv->base == 10 && serializer->priv->show_tsep && i == serializer->priv->tsep_count) {
- g_string_prepend_unichar(string, serializer->priv->tsep);
- i = 0;
- }
-
mp_set_from_mp(&t, &temp);
} while (!mp_is_zero(&temp));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]