diff options
author | Dom Lachowicz <domlachowicz@gmail.com> | 2006-11-30 22:10:41 +0000 |
---|---|---|
committer | Dom Lachowicz <doml@src.gnome.org> | 2006-11-30 22:10:41 +0000 |
commit | 748a03efa4624ce5e0ba730e19cbe5098a88f2cc (patch) | |
tree | 470061f7d0ea274b5cb3cb91130e4f50e41f9523 | |
parent | 7c3ac7d8e44e74a2a82b47403942e6d56e377566 (diff) | |
download | libcroco-748a03efa4624ce5e0ba730e19cbe5098a88f2cc.tar.gz |
Bug 381040 - floating numbers always output to exactly 3 digits after
2006-11-30 Dom Lachowicz <domlachowicz@gmail.com>
* src/cr-num.c: Bug 381040 - floating numbers always output to exactly 3 digits after decimal points.
Also fixed a related bug where libcroco wouldn't emit compliant CSS strings if run in a non-C locale.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/cr-num.c | 4 |
2 files changed, 8 insertions, 1 deletions
@@ -1,3 +1,8 @@ +2006-11-30 Dom Lachowicz <domlachowicz@gmail.com> + + * src/cr-num.c: Bug 381040 - floating numbers always output to exactly 3 digits after decimal points. + Also fixed a related bug where libcroco wouldn't emit compliant CSS strings if run in a non-C locale. + 2006-11-29 Dom Lachowicz <domlachowicz@gmail.com> * src/cr-token.c: Bug 380438 - Leak and trace message in cr_token_clear. diff --git a/src/cr-num.c b/src/cr-num.c index cce30ff..2a14011 100644 --- a/src/cr-num.c +++ b/src/cr-num.c @@ -107,7 +107,9 @@ cr_num_to_string (CRNum * a_this) if (!test_val) { tmp_char1 = g_strdup_printf ("%ld", (glong) a_this->val); } else { - tmp_char1 = g_strdup_printf ("%.3f", a_this->val); + tmp_char1 = g_new0 (char, G_ASCII_DTOSTR_BUF_SIZE + 1); + if (tmp_char1 != NULL) + g_ascii_dtostr (tmp_char1, G_ASCII_DTOSTR_BUF_SIZE, a_this->val); } g_return_val_if_fail (tmp_char1, NULL); |