Can I sum two fields?

328 views
Skip to first unread message

James

unread,
Oct 26, 2015, 2:00:05 AM10/26/15
to TiddlyWiki
Hi all,

I have several fields in on tiddler, each filed represent a total score for a team.  Can I add them together and displace in the content?

For instance,
field_A = 30
field_B = 20

Display : {fieldA + fieldB} ????? it will shows 50?

thanks.

Jed Carty

unread,
Oct 26, 2015, 4:39:21 AM10/26/15
to TiddlyWiki
I think that the two closest things currently around are the calc macro by Tobias, which can only add a numeric value to a value in a field, not sum two fields, and the various action widgets I made in MathyThing which are all action widgets and require a button press to update the output.
If you know javascript than either one could me modified to sum two fields and display the output but in that case I would suggest the calc macro because it is much smaller.

Tobias Beer

unread,
Oct 27, 2015, 4:30:08 AM10/27/15
to tiddl...@googlegroups.com
Hi James,

I have updated calc with a new parameter called by
allowing you to specify both values independently
either as a number or as a TextReference.

Get the update from here:


For example:

<<calc 3 + by:7>>
=> 10

<<calc !!foo + by:!!bar>>
=> adds values from field foo and bar

<<calc A!!foo * by:B##bar>>
=> multiplies value from field foo at tiddler A with numerical data at index bar in data-tiddler B

Best wishes,

— tb

magasine

unread,
Dec 19, 2015, 7:15:44 PM12/19/15
to tiddl...@googlegroups.com
The number of arguments is limited? I can not calculate the expression: <<calc "tiddler A!!valor" + by:"tiddler B!!valor" + by:"tiddler C!!fvalor">>

TIA,

Manoel
Campinas, SP - Brasil

Alex Hough

unread,
Dec 20, 2015, 1:29:57 AM12/20/15
to TiddlyWiki

On 20 December 2015 at 00:15, magasine <maga...@gmail.com> wrote:
The number of arguments is limited? I can not calculate the expression: << calc !!field_a + by:tiddler_b!! field_b + by:tiddler_c!!field_c >>

TIA,

Manoel
Campinas, SP - Brasil

Em terça-feira, 27 de outubro de 2015 06:30:08 UTC-2, Tobias Beer escreveu:
Hi James,

I have updated calc with a new parameter called by
allowing you to specify both values independently
either as a number or as a TextReference.

Get the update from here:


For example:

<<calc 3 + by:7>>
=> 10

<<calc !!foo + by:!!bar>>
=> adds values from field foo and bar

<<calc A!!foo * by:B##bar>>
=> multiplies value from field foo at tiddler A with numerical data at index bar in data-tiddler B

Best wishes,

— tb

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/6431d1fb-4dd1-40b7-9b3a-ceec89366039%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

magasine

unread,
Dec 20, 2015, 2:55:33 PM12/20/15
to TiddlyWiki

Perfect! TKS

Reply all
Reply to author
Forward
0 new messages