dictionary: New function dict_get_weight_format().
[pspp] / src / data / dictionary.c
index d34bd9a358214e19353ad7793d9f66cc1311a3c3..2a5f4d83e78846f8b9e5371515a68bdda875750d 100644 (file)
@@ -1072,6 +1072,13 @@ dict_get_case_weight (const struct dictionary *d, const struct ccase *c,
     }
 }
 
+/* Returns the format to use for weights. */
+const struct fmt_spec *
+dict_get_weight_format (const struct dictionary *d)
+{
+  return d->weight ? var_get_print_format (d->weight) : &F_8_0;
+}
+
 /* Sets the weighting variable of D to V, or turning off
    weighting if V is a null pointer. */
 void