From: Ben Pfaff Date: Fri, 1 Jan 2021 06:19:13 +0000 (-0800) Subject: pivot-table: Define numeric formats of categories as well as their cells. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=976917d3f661f4c4080d5478dbb73fb1ef29b451;p=pspp pivot-table: Define numeric formats of categories as well as their cells. --- diff --git a/src/output/pivot-table.c b/src/output/pivot-table.c index c255ea83b0..6029224734 100644 --- a/src/output/pivot-table.c +++ b/src/output/pivot-table.c @@ -396,6 +396,13 @@ pivot_category_set_rc (struct pivot_category *category, const char *s) category->dimension->table, s); if (format) category->format = *format; + + /* Ensure that the category itself, in addition to the cells within it, takes + the format. (It's kind of rare for a category to have a numeric format + though.) */ + struct pivot_value *name = category->name; + if (name->type == PIVOT_VALUE_NUMERIC && !name->numeric.format.w) + name->numeric.format = format ? *format : *settings_get_format (); } static void