Wiki-Quellcode von Calc Macro
Zeige letzte Bearbeiter
| author | version | line-number | content |
|---|---|---|---|
| 1 | |||
| 2 | This macro allows run calculation using velocity in wiki tables | ||
| 3 | |||
| 4 | == Macro Parameters == | ||
| 5 | |||
| 6 | |=Parameter|=Description|=Possible values|=Default value | ||
| 7 | |formula|Formula to use for the calculation in velocity|$B*$C or $row.get(2)*$row.get(3) for rows or $b*$c or $col.get(2)*$col.get(3) for columns|multiplication of the 2 columns to the left of the current column | ||
| 8 | |format|Display format of the resulting calculation. This uses DecimalFormat from java|0.00 Euros|0.00 | ||
| 9 | |||
| 10 | == Test Calculation in rows == | ||
| 11 | |||
| 12 | |=Desc|=Days|=Price|=Total HT|=Total TTC | ||
| 13 | |Test|3.5|600|{{calc formula="$B*$C" format="0.00 Euros" /}}|{{calc formula="$D*1.196" format="0.00 Euros" /}} | ||
| 14 | |||
| 15 | |||
| 16 | == Test Calculation in rows using $row == | ||
| 17 | |||
| 18 | |=Desc|=Days|=Price|=Total HT|=Total TTC | ||
| 19 | |Test|3|600.50|{{calc formula="$row.get(2)*$row.get(3)" format="0 Euros" /}}|{{calc formula="$row.get(4)*1.196" format="0 Euros" /}} | ||
| 20 | |||
| 21 | == Test Calculation in columns == | ||
| 22 | |||
| 23 | |=Desc|Test | ||
| 24 | |=Days|3.5 | ||
| 25 | |=Price|600| | ||
| 26 | |=Total HT|{{calc formula="$b*$c" format="0.00 Euros" /}} | ||
| 27 | |=Total TTC|{{calc formula="$d*1.196" format="0.00 Euros" /}} | ||
| 28 | |||
| 29 | == Test Calculation in columns using $col == | ||
| 30 | |||
| 31 | |=Desc|Test | ||
| 32 | |=Days|3 | ||
| 33 | |=Price|600.50| | ||
| 34 | |=Total HT|{{calc formula="$col.get(2)*$col.get(3)" format="0 Euros" /}} | ||
| 35 | |=Total TTC|{{calc formula="$col.get(4)*1.196" format="0 Euros" /}} |