Hello, all —
Evan, I find it confusing that
>
> 2+3*4 > 12 works but not "2+3*4 = 12" nor "2+3*4 == 12" .
>
> And why does (= pow(3, 2) =) work but not (= gr(3, 2) =) ?
>
(2+3*4 = 12) should work fine — it evaluates to FALSE. "==" is not an
operator, as it's not a conventional syntax for calculators, spreadsheets
or functional languages. (I say this as a C++ programmer!) I should note
that equality might evaluate to false in unexpected situations because of
floating-point error...
I don't know what the *GR* function should do. No such function exists in
Sheets, Excel or standard math libraries.
(1) Can I create a table like this that auto gives the results?...
> (2) Quite important. Can I in the interface just add a line? That would
> make for basic accounting bliss.
Formulas doesn't do UI, only calculation. So you can follow other
tutorials on how to make tables. In your case, I would suggest storing
expenses as Tiddlers tagged with *Expense*, with fields for date,
description and cost, where the date field is written in YYYY-MM-DD format.
I'm currently building your example as a test-run, but I've run into some
hitches due to bugs in the plugin:
<!-- note: we want dates in this format, and numbers displayed with two
digits after the decimal point. -->
<$vars formulaDateFormat="DD/mmm/YYYY" formulaFixed="2">
<table>
<!-- This first row is the table header. -->
<tr>
<th>Date</th>
<th>Description</th>
<th>Cost</th>
</tr>
<!-- This $list widget will show each of our expenses. -->
<$list filter="[prefix[Demo]tag[Expense]]">
<tr>
<td> <$link>(= {{!!date}} =)</$link> </td>
<td> {{!!summary}} </td>
<td> {{!!cost}} </td>
</tr>
</$list>
<!-- This row calculates a total. -->
<tr>
<td colspan="3"> <hr/> </td>
</tr>
<!-- This row calculates a total using SUM. -->
<tr>
<th> </th>
<th> TOTAL: </th>
<th>
(= sum([prefix[Demo]tag[Expense]get[cost]]) =)
</th>
</tr>
<!-- This row shows our average per day. This is a bit more complex! -->
<tr>
<td> </td>
<td> Average per day (December): </td>
<td> (= sum([prefix[Demo]tag[Expense]get[cost]]) / 31 =) </td>
</tr>
</table>
</$vars>
On Monday, 18 December 2017 10:41:51 UTC-6, Mat wrote:
>
> Josiah,
>
> (2) Quite important. Can I in the interface just add a line? That would
>> make for basic accounting bliss.
>>
>
> I'm pretty sure this is rather easily implemented by many people here so
> no worry if Evan doesn't personally make this.
>
> <:-)
>
--
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 [email protected].
To post to this group, send email to [email protected].
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/751b6f4d-6a59-45ef-8823-d37ac1b5facb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.