bobbingwide / oik-bob-bing-wide

More lazy smart shortcodes
https://www.oik-plugins.com/oik-plugins/oik-bob-bing-wide-more-lazy-smart-shortcodes/
GNU General Public License v2.0
1 stars 0 forks source link

Add totals= parameter to the [bw_csv] shortcode #32

Open bobbingwide opened 4 years ago

bobbingwide commented 4 years ago

I want to be able to automatically sum the values in columns in a CSV table and display this in a totals line. E.g. for this simple table with a totals line for totals=C,T,A It would be would be

A B C
1 2 3
4 5 6
2 7 4.5

Where the codes are

Code Meaning
C Count - i.e number of rows
T Total - sum of the rows in the column
A Average - average of the values in the column ( T / C )
No function

I haven’t decided about requirements when pagination is active.

bobbingwide commented 4 years ago

This option could also be supported by the oik-bbw/csv block.

bobbingwide commented 4 years ago

This was released in v1.34.0 on 30 Jan 2020. But it was only applied to the [bw_csv] shortcode. It needs to be added to the oik-bbw/csv block and the [bw_table] shortcode. I won’t close this issue yet.

bobbingwide commented 4 years ago

When I added the totals= parameter to oik's [bw_table] shortcode I needed to update the shared library file libs/class-oik-csv-totals.php.