xref: /plugin/avmathtable/README.md (revision 07316ee8740af8a332be22f4fb0f6941164af173)
1# DokuWiki Plugin: AV Math Table
2
3Adds math to columns for Dokuwiki tables.
4
5## Install and documentation:
6
7* https://www.dokuwiki.org/plugin:avmathtable
8* Licence: GPL-2.0 (https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
9* Author: Sherri W. (https://syntaxseed.com)
10
11## Usage
12
13### Format
14
15<img src="syntax.png" border="0" />
16
17```
18<mathtable>
19^ Name            ^ Deposited ^ Balance ^
20| John            |         25| 500     |
21| Mary            |       40.5| 680.5   |
22^ Subtotal        ^           ^ =TOT    ^
23| Lex             |         10| 140     |
24| Sue             |         18| 200.6   |
25^ Average / Total ^       =AVG^ =SUM    ^
26</mathtable>
27```
28
29Column headers (^) and alignment are preserved.
30
31### Available Commands
32
33Commands operate on the **numeric** column values above them. Non-numeric or cells with these special commands are ignored.
34
35* `=AVG` - Calculate the average of the numeric values in this column so far.
36* `=SUM` - Calculate the sum of the numeric values in this entire column so far.
37* `=TOT` - Calculate the total of the numeric values in this column since the last call to =TOT. Can be a section total.
38* `=ROW` - Works like SUM but for the current row. Sums the cells to the left of the one where this command is called. Does not work with other commands in the row. Ie can't sum a row of totals (yet).
39* `=CNT` - Display the number of numeric values in this column so far.
40* `=MAX` - Display the maximum numeric value in the column.
41* `=MIN` - Display the minimum numeric value in the column.
42
43### Output
44
45<img src="example.png" border="0" />
46
47## To Do
48
49Not yet tested with cells that span multiple columns or rows.
50
51## Version History
52
532026-03-14 - Add the TOT command. Added the (experimental) ROW command. Started gathering info about rows.
542026-02-26 - Make it work with 0 decimal numbers like for currency (8.00). Add MIN/MAX commands.
552026-02-25 - First version with basic functions.