Dotdown™ (beta)

Build a calculator by typing.

Type a dot and a command, and the calculator is there. It is built into Customise, so there is nothing to install.

A whole calculator

---
Bulk order price
What an order costs, with a discount above 100.
---
.settings { places: 2, rounding: up }
.input qty: Quantity positive
.input price: Price per unit (RM) positive
.r1 Subtotal (RM): qty × price
.r2 Total (RM): if qty > 100 then r1 × 0.9 else r1

Dotdown™ also exists in TinyForm, where it builds forms. The dot and the info block are the same; the math commands are new.

How it works

  1. Open the box. On Customise (/build), open “Dotdown™ (beta)”. On a phone it is already open.
  2. Type a dot. A menu of commands appears: .input, .list, .constant, .module, .sect and the next step. Pick one with Enter, Tab or a tap, or type the whole name and a sample line fills in.
  3. Press Enter. Press Ctrl/⌘ + Enter, or “To calculator ⤵”, and the builder below updates to match. Text with an error changes nothing and tells you which line.
  4. Go back and forth. “To text ⤴” writes the calculator you built back as text. Edit either side and bring it across.

The shape of a line

.r1 Subtotal (RM): qty × price
  • .r1 is the command. Steps are numbered .r1, .r2, … in order.
  • Subtotal is the label customers see, and (RM) is an optional unit.
  • After the colon is the formula. Later steps can use the result as r1.
  • You can type - * / for − × ÷.

Every command

WriteIt isRead more
---The title and description at the top.
.settingsDecimal places, rounding, and whether to show the working.
//A comment line, ignored.
.r1A step: a label and a formula. The last step is the answer.
sqrt, pmt, mean …Functions you can use inside a formula.
.inputA number the customer types in.
.listA list of numbers, for sum, mean, count and the like.
.constantFixed numbers you set, used as name.key.
.moduleA pick-from-a-menu widget over constants.
.sectA titled section.

A loan, as an example

Money functions work like Excel’s. See Functions for the signs.

# Home loan
.input loan: Loan amount (RM) positive
.input rate: Yearly interest (%) positive
.input years: Years positive
.r1 Monthly payment (RM): abs(pmt(rate ÷ 100 ÷ 12, years × 12, loan))
.r2 Paid in total (RM): r1 × years × 12
.r3 Interest (RM): r2 − loan
Open the builder