Your first calculation
Calc blocks let you work out costs, quantities and times right next to the plan they belong to. This page takes you from an empty block to a small budget that updates itself whenever you change a number.
Add a calc block
On a Mac, put the cursor on an empty line and choose Format › Calculation Block, or press ⌘Y. On iPhone or iPad, open a note, tap Edit, put the cursor on an empty line and tap Calculation Block on the formatting bar. Varlig inserts an empty block, ready for your first line.
You can also type the block yourself. Start a line with three backticks and the word calc, write your calculations underneath, and close the block with three backticks:
```calc
£3.40 * 5
```
Language and number formats
The app language and calculation formats are separate. Choose the interface language in Settings › General › Language on Mac, or Settings › Language on iPhone and iPad; it changes when you next open Varlig.
In Settings › Calculations, Number format controls how input is read: 1.5 + 2.5 with English (United States), or 1,5 + 2,5 with German (Germany). Answers can display the result in another format without changing how your input is read. A note can override these defaults with Calculation Settings for This Note….
Unless a section says otherwise, the examples in this Guide use English (United States) number format and English calculation keywords, even on translated pages. Set that format to paste them unchanged, or adapt the separators to your note. Some languages also have their own calculation phrases.
Type a line, see the answer
Each line is one calculation. As you type, its answer appears on the right.
£3.40 * 5 gives £17.0045 min + 1 hour 20 min gives 2 hours 5 min2.5 km in m gives 2,500 m20% off £80 gives £64.00split £90 among 3 people gives £30.00Lines can read the way you’d say them, so split £90 among 3 people gives the same answer as £90 / 3.
Click an answer to copy its exact value, ready to paste into an email or another app.
Start a line with # and a space to give a block a heading or leave yourself a note. Varlig skips that line and shows no answer.
Give values names
Write a name, an equals sign and a value. The line shows the value, and every line below can use the name.
# Dinner partyguests = 6 gives 6price = £18 gives £18.00food = guests * price gives £108.00drinks = £45 gives £45.00food + drinks gives £153.00Names can be more than one word, so ticket price = £18 works too. Named values make a block read like a sentence, and they are what make the next step possible.
Change a number and watch everything update
Two more friends are coming. Change guests = 6 to guests = 8, and every line that uses guests recalculates as you type:
# Dinner partyguests = 8 gives 8price = £18 gives £18.00food = guests * price gives £144.00drinks = £45 gives £45.00food + drinks gives £189.00This is the everyday habit worth building: write the plan once, then try out “what if” by editing a single value.
Names carry into later blocks
A name you define stays available in every calc block further down the same note, so you can write freely between calculations:
## Lisbon
```calc
hotel = €145 * 2
flights = €89 * 2
```
Sam and I are splitting everything.
```calc
(hotel + flights) / 2
```
The last block shows €234.00. Names belong to their note, so a hotel in one note never changes the answers in another.
The summary under each block
Each calc block shows a small summary beneath it, the Total of its answers to begin with. Click the summary to switch to Average, Median or Count, or to copy the value. Every block remembers its own choice, and you can hide a block’s summary from the same menu.
The summary only adds up lines in the block’s main unit or currency, the one most of its lines carry, so a count is never added to money: cocoa = €4, mornings = 5 and cocoa * mornings total €24, not €29. Money in other currencies is converted at the note’s exchange rates, and other units of the same kind, like 800 m beside 5 km, are converted to the main one. Plain numbers, percentages, dates and durations are left out when the main unit is something else, and the summary’s menu says which lines it left out. A block of plain numbers adds them all.
Options for a single line
Right-click a calculation line or its answer, then open Calculation Line:
| Option | What it does |
|---|---|
| Answer Format | Sets decimal places, thousands separators, large number notation and currency rounding for this line only. Reset Answer Format goes back to your defaults. |
| Subtotal | Shows the sum of the answers above, back to the previous subtotal, a --- divider or a # heading. Use it to total each section of a longer budget. A line that says only sum, total, subtotal, grand total or average does the same. |
| Time Point | Marks a fixed time, such as when you set off. The duration lines around it show the clock times they cover, which helps when planning a day or a journey. |
| Expression | Turns a subtotal or time point back into an ordinary line. |
| Plot Function… | Opens a graph of the line’s expression. Choose the variable and range, then click Plot. Your note isn’t changed. |
Settings for calculations
Settings › Calculations sets the defaults for every calc block. Choose Apply to save your changes.
| Section | What you can set |
|---|---|
| Numbers | Number format (how decimals and thousands are written where you live), and converting foreign numbers when you paste them |
| Answer Formatting | Decimal places, thousands separators and notation for large numbers |
| Currency | Rounding to currency precision, currency symbols and trailing zeros |
| Calculation summary | Whether blocks show a summary, which statistic it starts with, and which lines it includes |
| Variables | Updating later references when you rename a value |
| Everyday calculations | Hours per workday, and the name and rate of your sales tax |
| Shared definitions | A Definition sheet of values and custom units available in every note |
| Workday holidays | Dates to skip when counting workdays, one per line |
| Exchange rates | Hourly refresh of currency and crypto rates, and a Refresh Now button |
| Live data | Looking up the places and weather a line names |
Exchange rates, and lines that look up a place or the weather, need an internet connection; see Weather and places. Everything else in a calc block, including units and amounts in a single currency, works offline.
£24 in USD gives $32.40Where to go next
You now know enough to use calc blocks every day. When you want more, these guides show what a single line can do:
- Writing a calculation line: comments, labels, names and conditions.
- Percentages: discounts, tips, tax and “what percent is…” questions.
- Natural-language phrases: splitting bills, adding a tip and writing numbers in words.
- Units and conversions: converting and calculating with measurements.
- Money and currencies: amounts, symbols and live exchange rates.
- Dates and the calendar: days until, workdays and date arithmetic.