Hi! First time posting. I've been trying to figure this out all day, but I have to concede I won't figure it out.
My first big TW project is this personal budget calculator:
https://trumad.github.io/budgetlywiki/I'd really love to make the "Budget delta" result green when it's a positive number, and red when it's a negative number. You can see how the delta is calculated by editing the "
Budget Overview" tiddler:
(= {{Income Total}} - {{Expenses Total}} =)
And you can see that the tiddlers Income Total and Expenses Total each do their own calculations before one gets subtracted from the other. For example:
(= sum([tag[Expenses]get[value]]) =)
So what I tried to do was make a new tiddler called budgetDelta which would do the delta calculation. And then use the <$reveal widget to do a "lt" calculation on the budgetDelta tiddler:
<$reveal type="lt" state="budgetDelta" text="0">
Less than 0!
</$reveal>
However, it doesn't work if the budgetDelta tiddler has the formulas syntax in it. The calculation doesn't seem to be done. It maybe coerces the actual text of the formula to a number, and then decides whether it's less than 0, because if the calculations make the delta a minus number, it still doesn't register as being under 0. So I changed budgetDelta to just a plain integer in wikitext and it worked as expected. But obviously I need it to work as a formula, which the <$reveal widget uses to decide whether the value is less than 0.
I guess maybe the formulas plugin doesn't work properly with reveal, and I should find another way. But I'm stumped.
I hope I've been making some sense here. If anyone finds a way to make the text red if the number is less than 0, I'd be very grateful. It's obviously not a huge priority; the thing works as is. But I'm keen to learn what I'm doing wrong and how i can improve my TW knowledge. Thanks!