[pmwiki-users] Simple math

Robin Sheat robin at kallisti.net.nz
Thu Sep 21 09:09:37 CDT 2006

On Thursday 21 September 2006 00:05, Tom Lederer wrote:
> Is there a way to do some quick math in a wiki page?
I have an idea for an extension to this that would be useful. I use PmWiki to 
(among other things) keep track of hours worked. Currently I do:
||Date ||time start-time end ||hours ||
|| || ||''total hours'' ||

Is there a way to have the total hours line automatically calculated? Perhaps 
something that, if put in a table, checks all the columns above it, and if 
they're all numbers (or all start with numbers followed by whitespace, or 
something like that) inserts the sum. I'm thinking perhaps to replace the 
last line with something like:
|| || ||''(:sum:)'' ||

If the flexibility is there, how about automatically working out the hours by 
calculating based on the previous column, too, e.g:
||Date ||1000-1800 ||(:hours:) hours||
||Date ||1000-1800 ||8 hours ||

This isn't so much for laziness (although that's certainly a driving factor) 
but it would also help prevent simple maths errors, and stop me getting told 
off when I work it out wrong :)

I guess a natural extension of this is primitive spreadsheet type stuff, but 
that may be going too far...

Robin <robin at kallisti.net.nz> JabberID: <eythian at jabber.kallisti.net.nz>

Hostes alienigeni me abduxerunt. Qui annus est?

PGP Key 0xA99CEB6D = 5957 6D23 8B16 EFAB FEF8  7175 14D3 6485 A99C EB6D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
Url : /pipermail/pmwiki-users/attachments/20060922/51796cb6/attachment.bin 

More information about the pmwiki-users mailing list