/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2012 Free Software Foundation
+ Copyright (C) 2012, 2014 Free Software Foundation
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "psppire-dialog-action-binomial.h"
#include "psppire-value-entry.h"
+#include <float.h>
+
#include "dialog-common.h"
#include "helper.h"
#include <ui/syntax-gen.h>
#include "psppire-dialog.h"
#include "builder-wrapper.h"
-#include "checkbox-treeview.h"
#include "psppire-dict.h"
#include "libpspp/str.h"
gchar *text = NULL;
double prop;
- GString *string = g_string_new ("NPAR TEST\n\t/BINOMIAL");
+ struct string str;
+
+ ds_init_cstr (&str, "NPAR TEST\n\t/BINOMIAL");
if ( get_proportion (scd, &prop))
- g_string_append_printf (string, "(%g)", prop);
+ ds_put_c_format (&str, "(%.*g)", DBL_DIG + 1, prop);
- g_string_append (string, " =");
+ ds_put_cstr (&str, " =");
- psppire_var_view_append_names (PSPPIRE_VAR_VIEW (scd->var_view), 0, string);
+ psppire_var_view_append_names_str (PSPPIRE_VAR_VIEW (scd->var_view), 0, &str);
if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (scd->cutpoint_button)))
{
const gchar *cutpoint = gtk_entry_get_text (GTK_ENTRY (scd->cutpoint_entry));
- g_string_append_printf (string, "(%s)", cutpoint);
+ ds_put_c_format (&str, "(%s)", cutpoint);
}
- g_string_append (string, ".\n");
+ ds_put_cstr (&str, ".\n");
- text = string->str;
+ text = ds_steal_cstr (&str);
- g_string_free (string, FALSE);
+ ds_destroy (&str);
return text;
}