
\define ragscalculator(cnumb1,copera,cnumb2)
[[$cnumb1$]$copera$[$cnumb2$]]
\end
<div style="padding:10px; text-align:center; border:solid 2px; border-radius:6px;">
<div style=""><span style="font-size:120%;">CALCULATOR</span>
</div>
<div style="display: table; width:80%; margin:0px auto; padding:5px; border:inset 4px;">
<div style="display: table-row;">
<div style="display: table-cell;">
<$edit-text tiddler="$:/temp/ragscalculator" field="cnum1" placeholder="" tag="input" type="text" size="3"/>
</div>
<div style="display: table-cell;">
{{$:/temp/ragscalculator!!coper2}}
</div>
<div style="display: table-cell;">
<$edit-text tiddler="$:/temp/ragscalculator" field="cnum2" placeholder="" tag="input" type="text" size="3"/>
</div>
<div style="display: table-cell;">
= <$list filter={{$:/temp/ragscalculator!!cfinal}}><<currentTiddler>></$list>
</div>
</div>
</div>
<div style="margin-top:15px;">
<!-- -->
<$button class="tc-btn-rounded" style="font-size:120%;" set="$:/temp/ragscalculator!!coper" setTo="add" ><$action-setfield $tiddler="$:/temp/ragscalculator" coper2="+" /> + </$button>
<!-- -->
<$button class="tc-btn-rounded" style="font-size:120%;" set="$:/temp/ragscalculator!!coper" setTo="subtract" ><$action-setfield $tiddler="$:/temp/ragscalculator" coper2="-" /> - </$button>
<!-- -->
<$button class="tc-btn-rounded" style="font-size:120%;" set="$:/temp/ragscalculator!!coper" setTo="multiply" ><$action-setfield $tiddler="$:/temp/ragscalculator" coper2="x" /> x </$button>
<!-- -->
<$button class="tc-btn-rounded" style="font-size:120%;" set="$:/temp/ragscalculator!!coper" setTo="divide" ><$action-setfield $tiddler="$:/temp/ragscalculator" coper2="÷" /> ÷ </$button>
<!-- -->
<$set name="rcnum1" value={{$:/temp/ragscalculator!!cnum1}}>
<$set name="rcopera" value={{$:/temp/ragscalculator!!coper}}>
<$set name="rcnum2" value={{$:/temp/ragscalculator!!cnum2}}>
<$set name="rcfinalres" value={{$:/temp/ragscalculator!!cfinal}}>
<$button class="tc-btn-rounded" style="font-size:120%;" set="$:/temp/ragscalculator!!cfinal" setTo=<<ragscalculator $(rcnum1)$ $(rcopera)$ $(rcnum2)$>> > = </$button>
<!-- -->
<$button class="tc-btn-rounded" style="padding:0px 5px;font-size:120%;"><$action-setfield $tiddler="$:/temp/ragscalculator" cnum1="" /><$action-setfield $tiddler="$:/temp/ragscalculator" cnum2="" /> AC </$button>
<div style="width:60%; margin:30px auto; border:dotted 2px;">
//powered by WikiFilters//<br/>
__FILTER__: <$text text=<<ragscalculator $(rcnum1)$ $(rcopera)$ $(rcnum2)$>>/> = <$list filter={{$:/temp/ragscalculator!!cfinal}}><<currentTiddler>></$list>
</div>
</div>
</$set></$set></$set></$set>
</div>
Thanks for sharing. It demonstrates how much the mathematics opperators have extended tiddlywiki.
Lets see if you work can inspire others like a compound interest calculator and more.
Tony
Thanks for sharing. It demonstrates how much the mathematics opperators have extended tiddlywiki.Lets see if you work can inspire others like a compound interest calculator and more.
Sidebar calculator
What a perfectly neat idea!!! Makes so much sense!BTW, testing it out, I note a loose </div> tag seen in the visual display.