1package ui23import tea "charm.land/bubbletea/v2"45// File > Settings: workbook settings saved in the file. Sheets keeps its6// calculation settings there too.78func init() {9 register(&command{id: "settings.decimal", title: "Decimal arithmetic",10 desc: "Compute money exactly: + - * /, SUM, AVERAGE and ROUND in decimal, so 0.1+0.2 is 0.3",11 run: func(m *Model) tea.Cmd {12 on := !m.sheet.Decimal()13 m.sheet.SetDecimal(on)14 m.changed = m.sheet.StateID() != m.saved15 m.note = "Decimal arithmetic off: binary floating point, as in Sheets"16 if on {17 m.note = "Decimal arithmetic on: + - * /, SUM, AVERAGE and ROUND are exact in decimal"18 }19 return nil20 },21 checked: func(m *Model) bool { return m.sheet.Decimal() },22 })23}