aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calc.go6
-rw-r--r--ui.go2
2 files changed, 5 insertions, 3 deletions
diff --git a/calc.go b/calc.go
index 1d969cc..8a114a4 100644
--- a/calc.go
+++ b/calc.go
@@ -5,11 +5,11 @@ import (
"strings"
)
-type AngleMode int
+type AngleMode bool
const (
- modeDeg = iota
- modeRad
+ modeDeg = false
+ modeRad = true
)
type Calculator struct {
diff --git a/ui.go b/ui.go
index 877f11b..1360bcd 100644
--- a/ui.go
+++ b/ui.go
@@ -44,6 +44,8 @@ func (ui UI) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
case "C":
ui.calc.buf = ""
ui.calc.stack = ui.calc.stack[:0]
+ case "A":
+ ui.calc.anglem = !ui.calc.anglem
case "N":
ui.calc.negate()
case "+", "-", "*", "/", "%", "^":