[pmwiki-users] Simple math

Martin Fick mogulguy at yahoo.com
Thu Sep 21 14:29:01 CDT 2006

--- Robin Sheat <robin at kallisti.net.nz> wrote:

> On Thursday 21 September 2006 00:05, Tom Lederer
> wrote:
> 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:)'' ||

A cool idea, but this seems a like vague.  Should sum
consider the column or the row?  If the column, how
many rows...  

> 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||
> becoming:
> ||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...

Well, primitive spreadsheet stuff might seem easier
since it would not infer anything from your layout. 
Seems like a good use case for me to consider when
designing wikipaths and for Dominique when designing

Maybe something like:
(:eval sum({{$||1(2,3-14)}}) :)

sum rows 3 through 14 from column two of the first
table.  I have to admit, that's ugly. :(


Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the pmwiki-users mailing list