Skip to content
Varlig Guide
Varlig home

Natural-language phrases

Varlig understands a set of everyday English phrases as well as symbols. Reach for them when a line reads better in words: splitting a bill, pricing a few items in a basket, or taking three quarters of a recipe.

This page explains the rules behind those phrases: how Varlig reads a line, how numbers and fractions are spelt out, and how phrases combine. It isn’t free text, though. The full list is in the phrase reference. Percentage questions are covered in Percentages, and word forms of functions such as square root of 16 in Word-based mathematics.

How Varlig reads a phrase

A note mixes writing and maths, so Varlig reads each calculation line in two steps:

  1. It tries the whole line as a calculation, using every phrase Varlig knows. If the line fits, you get the phrase’s answer.
  2. Only if that fails does it set aside the words it doesn’t know and work out what’s left.

That means everyday phrases work on a line of their own, with nothing to put in front of them, while a line with a few stray words still adds up:

calc
two and a half hours in minutes gives 150 min
$62 with 18% tip gives $73.16
a third of £90 gives £30.00
5 apples + 3 oranges gives 8

You can still start a line with what is or calculate if you like how it reads. Varlig treats what is a third of £90 and a third of £90 the same way.

A short description around a phrase is fine: Varlig sets aside a few plain words before or after it, so coat £45 with 20% VAT and £45 with 20% VAT please still add the VAT, and 65 kg in pounds for the team still converts. For longer notes, or to be certain, put the description in a label or a comment:

calc
coat £45 with 20% VAT gives £54.00
£45 with 20% VAT please gives £54.00
65 kg in pounds for the team gives 143.3004704202 lb
Coat: £45 with 20% VAT gives £54.00
£45 with 20% VAT # new winter coat for Sam gives £54.00

Phrases that already name what they count, such as split £90 among 3 friends, need to end there: add a comment rather than more words after the noun.

Writing a calculation line covers comments and labels.

Numbers in words

Whole numbers can be written out, with or without and and hyphens:

calc
twelve hundred gives 1,200
one hundred and twenty gives 120
twenty-five plus five gives 30

For decimals, say point and then each digit on its own. one point two five is 1.25; one point twenty five isn’t accepted.

calc
three point one four gives 3.14
one point two five times four gives 5

Fractions

Spoken fractions work with of, and as mixed numbers in front of a unit:

calc
three quarters of 200 gives 150
two thirds of 450 g gives 300 g
a quarter of 200 gives 50
third of 90 gives 30
two and three quarters hours gives 2.75 hours

The denominators are half, third, quarter (or fourth), fifth, sixth, seventh, eighth, ninth and tenth, plus their plurals such as thirds and halves. The a is optional, so quarter of 100 is 25, while third of March is still a date. Fractions stay exact, so one third times three is exactly 1, not 0.9999999999.

Parts of an hour read the way you’d say them, and come out in hours and minutes:

calc
half an hour + 20 min gives 50 min
quarter of an hour gives 15 min
an hour and a half gives 1 hour 30 min

Arithmetic in words

Use plus, minus, times, multiplied by and divided by, mixed freely with digits and symbols. The usual order of operations applies: multiplication and division come before addition and subtraction. Use parentheses to group things differently.

calc
fifty times twenty plus ten gives 1,010
twenty divided by five plus two multiplied by three gives 10
(two plus three) times four gives 20
seven times £8.50 gives £59.50

Shopping: items, discounts, tax and tips

N items at P each multiplies a count by a price. Use whatever word suits the purchase in place of items, such as tickets, coffees or bottles, and leave out each or write @ when that reads better. after P% discount and with P% off take a percentage off the amount before them, and with P% tax, with P% VAT, with P% GST or with P% tip add one on. Capitals don’t matter, so with 20% vat works too.

calc
3 tickets at £12.50 each gives £37.50
3 coffees @ £2.80 gives £8.40
2 adults at £15 + 3 children at £8 gives £54.00
£15 each for 4 people gives £60.00
£80 after 25% discount gives £60.00
£80 with 25% off gives £60.00
£45 with 20% VAT gives £54.00
$62 with 18% tip gives $73.16
5 items at $20 each after 15% discount with 8% tax gives $91.80

With each, the count must be a whole number, 0 or more. Without it, any amount works, which suits things sold by weight or volume. The price can be a plain number or an amount of money.

calc
2.5 tickets at £4 each gives Unsupported: count must be a non-negative whole number
12 gallons at $3.59 gives $43.08
2.5 kg at £4 gives £10.00

Adjustments apply from left to right, each to the result so far. Two 10% discounts take 19% off in total, not 20%, and a tip added after tax is a share of the taxed amount:

calc
£50 after 10% discount after 10% discount gives £40.50
$84 with 8% tax with 15% tip gives $104.33

Splitting a bill

These forms divide a total between a number of people:

calc
split £90 among 3 gives £30.00
share £90 between 3 gives £30.00
£90 split among 3 gives £30.00
£90 between 3 gives £30.00
£90 split 3 ways gives £30.00

You can say who’s sharing after the count, which helps a note read naturally:

calc
split £100 among 3 people gives £33.33
share £60 between 4 friends gives £15.00

The count must be a whole number. Splitting among 0 shows Error: divide by zero. When the total is itself a calculation, wrap it in parentheses so it’s clear what’s being split. Named values work too:

calc
split (£60 + £24) among 3 gives £28.00
bill = £84
people = 3
split bill among people gives £28.00

Phrases also work inside a condition. Only the branch that applies is worked out:

calc
bill = £112
people = 4
if bill > £100 then split bill among people else bill gives £28.00

Less than and more than

A less than B subtracts A from B, and A more than B adds A to B:

calc
£15 less than £80 gives £65.00
5 less than 20 gives 15
£15 more than £80 gives £95.00
5 more than 20 gives 25

the difference between tells you how far apart two amounts are, whichever you write first, so the answer is never negative:

calc
the difference between £85 and £120 gives £35.00

Converting the result

A conversion at the end of a line applies to the whole phrase’s result. You can write in, to, as, -> or , as described in Units and conversions:

calc
two and three quarters hours in minutes gives 165 min
three quarters of 2 kg in g gives 1,500 g

Currency conversions use the European Central Bank’s daily rates, so the answer changes from day to day:

calcAnswers depend on today’s date or live data
split 120 among 4 in USD gives $35.10

Your names come first

If a variable in your note has the same name as a word in a phrase, your variable wins. Here share is a percentage, so the second line takes 25% of £2,000 rather than trying to share anything:

calc
share = 25%
share of £2,000 gives £500.00

The same goes for number words: after one = 7, one times two is 14. Choose other names, or use a different form of the phrase, when that isn’t what you want.

Everyday names don’t get in the way of counting, though. A number written straight before a plural name counts that thing, so a note can have its own people and still split a bill for a different group:

calc
people = 4
split £1480 among 5 people gives £296.00
split £1480 among people gives £370.00

Hold the pointer over people on the first split to see “Counts people here, not the variable people = 4.”

This also means you can name things the way you think of them. A name can borrow a function’s name, such as floor, or contain phrase words such as to, in or needed, and Varlig reads it as your value:

calc
floor = 12
floor * 2 gives 24 m²
paint needed = 12.44 L
paint needed to 1 dp gives 12.4 L

Names has more on choosing names.

What isn’t understood

Some notation looks like maths but isn’t supported. Rather than work out part of the line and give a misleading answer, Varlig shows an error:

calc
2d6 gives Unsupported: Dice notation is not supported at "d"
10 ± 0.5 gives Unsupported: Uncertainty notation is not supported at "±"
5 < 4 < 10 gives Unsupported: Comparison chains are not supported at "<"; combine separate comparisons with &&

Each message quotes the symbol where Varlig stopped, so you can see straight away what to change.

10 +/- 0.5 gives the same uncertainty error. For a range check, write two comparisons joined with &&, such as 4 < 5 && 5 < 10. See Operators, comparisons and conditionals.

Putting it together

Here is a restaurant bill for four, with the discounted wine, service and each person’s share worked out in words:

calc
# Dinner out
mains = 4 items at £17.50 each gives £70.00
wine = 2 bottles at £28 each after 25% discount gives £42.00
bill = mains + wine gives £112.00
people = 4
total = bill with 12.5% tip gives £126.00
split total among people gives £31.50

Each line reads the way you’d say it out loud. Change people or a price, and the share updates.