Commit 812b32e9 authored by Benjamin Otte's avatar Benjamin Otte

styleproperty: Add a helper function for printing doubles

We will want to print doubles more often, so add a little helper
function for it. We cannot use printf() here, because we want English
locale output.
parent 97a07a79
......@@ -313,15 +313,22 @@ double_value_parse (GtkCssParser *parser,
}
static void
double_value_print (const GValue *value,
GString *string)
string_append_double (GString *string,
double d)
{
char buf[G_ASCII_DTOSTR_BUF_SIZE];
g_ascii_dtostr (buf, sizeof (buf), g_value_get_double (value));
g_ascii_dtostr (buf, sizeof (buf), d);
g_string_append (string, buf);
}
static void
double_value_print (const GValue *value,
GString *string)
{
string_append_double (string, g_value_get_double (value));
}
static gboolean
float_value_parse (GtkCssParser *parser,
GFile *base,
......@@ -343,10 +350,7 @@ static void
float_value_print (const GValue *value,
GString *string)
{
char buf[G_ASCII_DTOSTR_BUF_SIZE];
g_ascii_dtostr (buf, sizeof (buf), g_value_get_float (value));
g_string_append (string, buf);
string_append_double (string, g_value_get_float (value));
}
static gboolean
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment