summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDom Lachowicz <domlachowicz@gmail.com>2006-11-30 22:10:41 +0000
committerDom Lachowicz <doml@src.gnome.org>2006-11-30 22:10:41 +0000
commit748a03efa4624ce5e0ba730e19cbe5098a88f2cc (patch)
tree470061f7d0ea274b5cb3cb91130e4f50e41f9523 /src
parent7c3ac7d8e44e74a2a82b47403942e6d56e377566 (diff)
downloadlibcroco-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.
Diffstat (limited to 'src')
-rw-r--r--src/cr-num.c4
1 files changed, 3 insertions, 1 deletions
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);