# Basic Calculator

**URL:** <https://community.blaze.today/t/basic-calculator/68771>\
**Category:** Show and Tell\
**Created:** [October 23, 2026, 7:09pm UTC](https://community.blaze.today/t/basic-calculator/68771 "2026-10-23T19:09:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tonydow](https://community.blaze.today/user_avatar/community.blaze.today/tonydow/32/18761_2.png) [@tonydow](https://community.blaze.today/u/tonydow)\
**Post date:** [October 23, 2026, 7:09pm UTC](https://community.blaze.today/t/basic-calculator/68771/1 "2026-10-23T19:09:26Z")

</div>

A simple calculator. My thanks to @samliew for the inspiration to create this.

{note: trim=left; insert=no; preview=yes; color=none}  
{repeat: for c in split(top, "|")}{button: text={=concat(text,c)}; label={=c}}{endrepeat}  
{repeat: for c in split(mid, "|")}{button: text={=concat(text,c)}; label={=c}}{endrepeat}  
{repeat: for c in split(bottom, "|")}{button: text={=concat(text,c)}; label={=c}}{endrepeat}  
{repeat: for c in split(zero, "|")}{button: text={=concat(text,c)}; label={=c}}{endrepeat}  
{repeat: for c in split(misc1, "|")}{button: text={=concat(text,c)}; label={=c}}{endrepeat}  
{repeat: for c in split(misc2, "|")}{button: text={=concat(text,c)}; label={=c}}{endrepeat}{endnote}  
{top="7|8|9"}{mid="4|5|6"}{bottom="1|2|3"}{zero="0|."}{misc1="+|-|\*|/"}{misc2="^|(|)"}  
{note}{formtext: name=text; default=0; cols=20}{endnote} = {=("() -\> " & text)()} {button: text=0; label=Clear}  
{formmenu: default=sin; cos; tan; log; ln; sqrt; name=trig; cols=6} {result=catch(("() -\> " & text)(), "")}  
{if: trig = "sin"; trim=right}  
{=(sin(result))}  
{elseif: trig = "cos"; trim=yes}  
{=(cos(result))}  
{elseif: trig = "tan"; trim=yes}  
{=(tan(result))}  
{elseif: trig = "log"; trim=yes}  
{=(log(result))}  
{elseif: trig = "ln"; trim=yes}  
{=(ln(result))}  
{elseif: trig = "sqrt"; trim=yes}  
{=(sqrt(result))}{endif}
