diff options
author | Alan Fitton <ajf@eth0.org.uk> | 2011-10-17 19:49:47 +0000 |
---|---|---|
committer | Alan Fitton <ajf@eth0.org.uk> | 2011-10-17 19:49:47 +0000 |
commit | 78f317d6c280e359ce38b3892a1c9a7b96e50ca2 (patch) | |
tree | 522dceb850d382a4464016755e3aed8528a00bfd /src/util.c | |
parent | 6d34e1fcf79845eabb5aafb008e8bffa47acf4f7 (diff) |
issue 151, issue 100
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -384,13 +384,19 @@ void trg_widget_set_visible(GtkWidget * w, gboolean visible) { gdouble json_double_to_progress(JsonNode *n) { + return json_node_really_get_double(n)*100.0; +} + +gdouble json_node_really_get_double(JsonNode *node) +{ GValue a = { 0 }; - json_node_get_value(n, &a); + + json_node_get_value(node, &a); switch (G_VALUE_TYPE(&a)) { case G_TYPE_INT64: - return (gdouble) g_value_get_int64(&a) * 100.0; + return (gdouble) g_value_get_int64(&a); case G_TYPE_DOUBLE: - return g_value_get_double(&a) * 100.0; + return g_value_get_double(&a); default: return 0.0; } |