Dotdown™ · settings

Settings and info

The top of a calculator: its name, how it rounds, and notes to yourself.

Title and description

---
Bulk order price
What an order costs, with a discount above 100.
---
.input qty: Quantity
.r1 Total: qty × 12
  • Between two --- lines at the very top: the first line is the title, the next lines the description.
  • Optional. Without the block, a first line starting with # is the title and the plain line after it is the description.
# Bulk order price
What an order costs.
.input qty: Quantity

Settings

.settings, then the keys between braces, before any other command — the same name { key: value } shape as .module and .constant.

.settings { places: 2, rounding: up, round-each-step, show-steps: false }
SettingDoes
placesDecimal places shown, a whole number from 0 to 10.
roundinghalf-up, up or down. Usually 2 places, half-up.
round-each-stepRound every step before the next one uses it.
show-stepsList every step’s result above the final answer. On unless you write show-steps: false.
show-workingShow each step’s formula in words with the customer’s numbers filled in. Off unless named, because it reveals your pricing.
  • The last three are switches: naming one turns it on, and : false turns it off.
  • Only the settings you write change. The rest keep their usual value, and “To text” writes only what differs from it.

Places and rounding

Rounding to 0 places:

rounding2.52.1-2.9
half-up32-3
up33-2
down22-3
  • half-up rounds halves away from zero like school maths. up always goes to the higher value and down to the lower one, so on a negative number up moves toward zero.
  • Results show exactly the places you set, so 12.5 with 2 places shows 12.50.

Round each step

.settings { places: 2, round-each-step }
.r1 A third: 1 ÷ 3
.r2 Times three: r1 × 3
// 0.99, because r1 was rounded to 0.33 first
// without round-each-step: 1.00

Use it when the calculator should match a receipt or a printed table, where every line is rounded before it is added.

Comments

// the discount starts above 100
.r1 Discount: if qty > 100 then qty × 0.1 else 0
  • A line starting with // is a note to yourself and is ignored.
  • Comments are not saved in the calculator, so they are gone after “To text” or when the box is reopened.
  • Ctrl/⌘ + / comments the selected lines. See Editor keys.
Open the builder