From: John Darrington Date: Sun, 14 Sep 2008 13:29:53 +0000 (+0800) Subject: Don't append % to count totals. X-Git-Tag: v0.6.1~11 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7ce6874eaf41e67636bbc5677b3b5016fa2324cc;p=pspp-builds.git Don't append % to count totals. There was an erroneous '%' appended to the totals for count values. This change removes it. Fixes bug #24003 --- diff --git a/src/language/stats/crosstabs.q b/src/language/stats/crosstabs.q index fcfccc39..4c5309bf 100644 --- a/src/language/stats/crosstabs.q +++ b/src/language/stats/crosstabs.q @@ -1861,7 +1861,6 @@ display_crosstabulation (void) tab_offset (table, -1, tab_row (table) - num_cells * n_rows); for (r = 0; r < n_rows; r++) { - char suffix = 0; bool mark_missing = false; if (cmd.miss == CRS_REPORT @@ -1870,6 +1869,7 @@ display_crosstabulation (void) for (i = 0; i < num_cells; i++) { + char suffix = 0; double v; switch (cells[i]) @@ -1878,7 +1878,7 @@ display_crosstabulation (void) v = row_tot[r]; break; case CRS_CL_ROW: - v = 100.; + v = 100.0; suffix = '%'; break; case CRS_CL_COLUMN: @@ -1916,7 +1916,6 @@ display_crosstabulation (void) { double ct = c < n_cols ? col_tot[c] : W; bool mark_missing = false; - char suffix = 0; int i; if (cmd.miss == CRS_REPORT && c < n_cols @@ -1925,13 +1924,13 @@ display_crosstabulation (void) for (i = 0; i < num_cells; i++) { + char suffix = 0; double v; switch (cells[i]) { case CRS_CL_COUNT: v = ct; - suffix = '%'; break; case CRS_CL_ROW: v = ct / W * 100.; @@ -1954,7 +1953,7 @@ display_crosstabulation (void) NOT_REACHED (); } - format_cell_entry (table, c, i, v, suffix, mark_missing); + format_cell_entry (table, c, i, v, suffix, mark_missing); } last_row = i; } diff --git a/tests/bugs/crosstabs-crash.sh b/tests/bugs/crosstabs-crash.sh index 99ec07ca..eea89304 100755 --- a/tests/bugs/crosstabs-crash.sh +++ b/tests/bugs/crosstabs-crash.sh @@ -108,7 +108,7 @@ diff -b -w $TEMPDIR/pspp.list - << EOF # 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%# +#Total # .0| .0| .0| .0| 1.0| .0| .0| 1.0# #===============#========#========#========#========#========#========#========#========# EOF if [ $? -ne 0 ] ; then fail ; fi diff --git a/tests/bugs/crosstabs-crash2.sh b/tests/bugs/crosstabs-crash2.sh index 5866d0e5..060fa234 100755 --- a/tests/bugs/crosstabs-crash2.sh +++ b/tests/bugs/crosstabs-crash2.sh @@ -108,7 +108,7 @@ $TEMPDIR/crosstabs-crash2.sh.sps:6: warning: BEGIN DATA: Missing value(s) for al # 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%# +#Total # 1.0| 1.0| 1.0| 1.0| 4.0# #===============#========#========#========#========#========# EOF if [ $? -ne 0 ] ; then fail ; fi diff --git a/tests/command/longvars.sh b/tests/command/longvars.sh index 2a75f64b..49a7cd4c 100755 --- a/tests/command/longvars.sh +++ b/tests/command/longvars.sh @@ -119,7 +119,7 @@ AlphaBetaGamma B X Yabbadabbadoo # 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%# +#Total # .0| .0| .0| .0| 1.0| .0| .0| 1.0# #===============#========#========#========#========#========#========#========#========# EOF if [ $? -ne 0 ] ; then fail ; fi