CROSSTABS: Use FORMAT setting to control output format.
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 24 Nov 2012 19:11:17 +0000 (11:11 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Sat, 24 Nov 2012 19:14:32 +0000 (11:14 -0800)
Reported by Daniel Harper.

src/language/stats/crosstabs.q
tests/language/lexer/variable-parser.at
tests/language/stats/crosstabs.at

index 65e92091cda71760826a82c5bd36b46c5deaa2d3..67f585593950d3e39b6a457fede0da1a3499acee 100644 (file)
@@ -1519,14 +1519,13 @@ static void
 format_cell_entry (struct tab_table *table, int c, int r, double value,
                    char suffix, bool mark_missing, const struct dictionary *dict)
 {
-  const struct fmt_spec f = {FMT_F, 10, 1};
   union value v;
   char suffixes[3];
   int suffix_len;
   char *s;
 
   v.f = value;
-  s = data_out (&v, dict_get_encoding (dict), &f);
+  s = data_out (&v, dict_get_encoding (dict), settings_get_format ());
 
   suffix_len = 0;
   if (suffix != 0)
index f5aed6bdb64d9086f24af2ddcb11135c229af4b5..59609f0380d8908060a7deb2c5dad3e594576e4c 100644 (file)
@@ -38,13 +38,13 @@ X * Yabbadabbadoo,1,100.0%,0,0.0%,1,100.0%
 Table: X * Yabbadabbadoo [[count]].
 ,Yabbadabbadoo,,,,,,,
 X,1.00,2.00,3.00,4.00,5.00,6.00,7.00,Total
-1.00,.0,.0,.0,.0,.0,.0,.0,.0
-2.00,.0,.0,.0,.0,.0,.0,.0,.0
-3.00,.0,.0,.0,.0,.0,.0,.0,.0
-4.00,.0,.0,.0,.0,1.0,.0,.0,1.0
-5.00,.0,.0,.0,.0,.0,.0,.0,.0
-6.00,.0,.0,.0,.0,.0,.0,.0,.0
-7.00,.0,.0,.0,.0,.0,.0,.0,.0
-Total,.0,.0,.0,.0,1.0,.0,.0,1.0
+1.00,.00,.00,.00,.00,.00,.00,.00,.00
+2.00,.00,.00,.00,.00,.00,.00,.00,.00
+3.00,.00,.00,.00,.00,.00,.00,.00,.00
+4.00,.00,.00,.00,.00,1.00,.00,.00,1.00
+5.00,.00,.00,.00,.00,.00,.00,.00,.00
+6.00,.00,.00,.00,.00,.00,.00,.00,.00
+7.00,.00,.00,.00,.00,.00,.00,.00,.00
+Total,.00,.00,.00,.00,1.00,.00,.00,1.00
 ])
 AT_CLEANUP
index 1647e4bd6113bbb7ca5456a7b8885244890aa044..67571dd93e876d97044ab09e4ed55d4dd916cb7c 100644 (file)
@@ -26,14 +26,14 @@ X * Y,1,100.0%,0,0.0%,1,100.0%
 Table: X * Y [count].
 ,Y,,,,,,,
 X,1.00,2.00,3.00,4.00,5.00,6.00,7.00,Total
-1.00,.0,.0,.0,.0,.0,.0,.0,.0
-2.00,.0,.0,.0,.0,.0,.0,.0,.0
-3.00,.0,.0,.0,.0,.0,.0,.0,.0
-4.00,.0,.0,.0,.0,1.0,.0,.0,1.0
-5.00,.0,.0,.0,.0,.0,.0,.0,.0
-6.00,.0,.0,.0,.0,.0,.0,.0,.0
-7.00,.0,.0,.0,.0,.0,.0,.0,.0
-Total,.0,.0,.0,.0,1.0,.0,.0,1.0
+1.00,.00,.00,.00,.00,.00,.00,.00,.00
+2.00,.00,.00,.00,.00,.00,.00,.00,.00
+3.00,.00,.00,.00,.00,.00,.00,.00,.00
+4.00,.00,.00,.00,.00,1.00,.00,.00,1.00
+5.00,.00,.00,.00,.00,.00,.00,.00,.00
+6.00,.00,.00,.00,.00,.00,.00,.00,.00
+7.00,.00,.00,.00,.00,.00,.00,.00,.00
+Total,.00,.00,.00,.00,1.00,.00,.00,1.00
 ]])
 AT_CLEANUP
 
@@ -72,10 +72,10 @@ x * y,4,66.7%,2,33.3%,6,100.0%
 Table: x * y [count].
 ,y,,,,
 x,one unity         ,three lots        ,two duality       ,zero none         ,Total
-1.00,1.0,.0,.0,1.0,2.0
-2.00,.0,.0,1.0,.0,1.0
-3.00,.0,1.0,.0,.0,1.0
-Total,1.0,1.0,1.0,1.0,4.0
+1.00,1.00,.00,.00,1.00,2.00
+2.00,.00,.00,1.00,.00,1.00
+3.00,.00,1.00,.00,.00,1.00
+Total,1.00,1.00,1.00,1.00,4.00
 ]])
 AT_CLEANUP
 
@@ -131,9 +131,9 @@ y * z,9,100.0%,0,0.0%,9,100.0%
 Table: y * z [count].
 ,z,,
 y,1,2,Total
-1,4.0,3.0,7.0
-2,1.0,1.0,2.0
-Total,5.0,4.0,9.0
+1,4.00,3.00,7.00
+2,1.00,1.00,2.00
+Total,5.00,4.00,9.00
 ]])
 AT_CLEANUP
 
@@ -168,10 +168,10 @@ x * y,4,100.0%,0,0.0%,4,100.0%
 Table: x * y [count].
 ,y,,
 x,1.00,2.00,Total
-2.00,.0,1.0,1.0
-3.00,1.0,.0,1.0
-4.00,1.0,1.0,2.0
-Total,2.0,2.0,4.0
+2.00,.00,1.00,1.00
+3.00,1.00,.00,1.00
+4.00,1.00,1.00,2.00
+Total,2.00,2.00,4.00
 
 Table: Chi-square tests.
 Statistic,Value,df,Asymp. Sig. (2-tailed)
@@ -220,18 +220,18 @@ v1 * v2,6,100.0%,0,0.0%,6,100.0%
 "Table: v1 * v2 [count, row %, column %, total %]."
 ,v2,,
 v1,e ,f ,Total
-c ,3.0,1.0,4.0
-,75.0%,25.0%,100.0%
-,75.0%,50.0%,66.7%
-,50.0%,16.7%,66.7%
-d ,1.0,1.0,2.0
-,50.0%,50.0%,100.0%
-,25.0%,50.0%,33.3%
-,16.7%,16.7%,33.3%
-Total,4.0,2.0,6.0
-,66.7%,33.3%,100.0%
-,100.0%,100.0%,100.0%
-,66.7%,33.3%,100.0%
+c ,3.00,1.00,4.00
+,75.00%,25.00%,100.00%
+,75.00%,50.00%,66.67%
+,50.00%,16.67%,66.67%
+d ,1.00,1.00,2.00
+,50.00%,50.00%,100.00%
+,25.00%,50.00%,33.33%
+,16.67%,16.67%,33.33%
+Total,4.00,2.00,6.00
+,66.67%,33.33%,100.00%
+,100.00%,100.00%,100.00%
+,66.67%,33.33%,100.00%
 
 Table: Chi-square tests.
 Statistic,Value,df,Asymp. Sig. (2-tailed),Exact Sig. (2-tailed),Exact Sig. (1-tailed)
@@ -253,18 +253,18 @@ v1 * v2,4,100.0%,0,0.0%,4,100.0%
 "Table: v1 * v2 [count, row %, column %, total %]."
 ,v2,,
 v1,e ,f ,Total
-c ,.0,1.0,1.0
-,.0%,100.0%,100.0%
-,.0%,33.3%,25.0%
-,.0%,25.0%,25.0%
-d ,1.0,2.0,3.0
-,33.3%,66.7%,100.0%
-,100.0%,66.7%,75.0%
-,25.0%,50.0%,75.0%
-Total,1.0,3.0,4.0
-,25.0%,75.0%,100.0%
-,100.0%,100.0%,100.0%
-,25.0%,75.0%,100.0%
+c ,.00,1.00,1.00
+,.00%,100.00%,100.00%
+,.00%,33.33%,25.00%
+,.00%,25.00%,25.00%
+d ,1.00,2.00,3.00
+,33.33%,66.67%,100.00%
+,100.00%,66.67%,75.00%
+,25.00%,50.00%,75.00%
+Total,1.00,3.00,4.00
+,25.00%,75.00%,100.00%
+,100.00%,100.00%,100.00%
+,25.00%,75.00%,100.00%
 
 Table: Chi-square tests.
 Statistic,Value,df,Asymp. Sig. (2-tailed),Exact Sig. (2-tailed),Exact Sig. (1-tailed)
@@ -329,17 +329,17 @@ x * y * z,9,100.0%,0,0.0%,9,100.0%
 Table: x * y * z [count].
 z,,y,,
 ,x,1,2,Total
-1,1,1.0,.0,1.0
-,3,1.0,.0,1.0
-,5,.0,1.0,1.0
-,7,1.0,.0,1.0
-,8,1.0,.0,1.0
-Total,,4.0,1.0,5.0
-2,2,.0,1.0,1.0
-,4,1.0,.0,1.0
-,6,1.0,.0,1.0
-,9,1.0,.0,1.0
-Total,,3.0,1.0,4.0
+1,1,1.00,.00,1.00
+,3,1.00,.00,1.00
+,5,.00,1.00,1.00
+,7,1.00,.00,1.00
+,8,1.00,.00,1.00
+Total,,4.00,1.00,5.00
+2,2,.00,1.00,1.00
+,4,1.00,.00,1.00
+,6,1.00,.00,1.00
+,9,1.00,.00,1.00
+Total,,3.00,1.00,4.00
 
 Table: Chi-square tests.
 z,Statistic,Value,df,Asymp. Sig. (2-tailed)
@@ -433,10 +433,10 @@ x * y,6,100.0%,0,0.0%,6,100.0%
 Table: x * y [count].
 ,y,,
 x,2.00,1.00,Total
-4.00,.0,1.0,1.0
-3.00,2.0,1.0,3.0
-2.00,2.0,.0,2.0
-Total,4.0,2.0,6.0
+4.00,.00,1.00,1.00
+3.00,2.00,1.00,3.00
+2.00,2.00,.00,2.00
+Total,4.00,2.00,6.00
 ]])
 AT_CLEANUP