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:
- It tries the whole line as a calculation, using every phrase Varlig knows. If the line fits, you get the phrase’s answer.
- 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:
two and a half hours in minutes gives 150 min$62 with 18% tip gives $73.16a third of £90 gives £30.005 apples + 3 oranges gives 8You 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:
coat £45 with 20% VAT gives £54.00£45 with 20% VAT please gives £54.0065 kg in pounds for the team gives 143.3004704202 lbCoat: £45 with 20% VAT gives £54.00£45 with 20% VAT # new winter coat for Sam gives £54.00Phrases 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:
twelve hundred gives 1,200one hundred and twenty gives 120twenty-five plus five gives 30For decimals, say point and then each digit on its own. one point two five is 1.25;
one point twenty five isn’t accepted.
three point one four gives 3.14one point two five times four gives 5Fractions
Spoken fractions work with of, and as mixed numbers in front of a unit:
three quarters of 200 gives 150two thirds of 450 g gives 300 ga quarter of 200 gives 50third of 90 gives 30two and three quarters hours gives 2.75 hoursThe 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:
half an hour + 20 min gives 50 minquarter of an hour gives 15 minan hour and a half gives 1 hour 30 minArithmetic 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.
fifty times twenty plus ten gives 1,010twenty divided by five plus two multiplied by three gives 10(two plus three) times four gives 20seven times £8.50 gives £59.50Shopping: 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.
3 tickets at £12.50 each gives £37.503 coffees @ £2.80 gives £8.402 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.165 items at $20 each after 15% discount with 8% tax gives $91.80With 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.
2.5 tickets at £4 each gives Unsupported: count must be a non-negative whole number12 gallons at $3.59 gives $43.082.5 kg at £4 gives £10.00Adjustments 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:
£50 after 10% discount after 10% discount gives £40.50$84 with 8% tax with 15% tip gives $104.33Splitting a bill
These forms divide a total between a number of people:
split £90 among 3 gives £30.00share £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.00You can say who’s sharing after the count, which helps a note read naturally:
split £100 among 3 people gives £33.33share £60 between 4 friends gives £15.00The 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:
split (£60 + £24) among 3 gives £28.00bill = £84people = 3split bill among people gives £28.00Phrases also work inside a condition. Only the branch that applies is worked out:
bill = £112people = 4if bill > £100 then split bill among people else bill gives £28.00Less than and more than
A less than B subtracts A from B, and A more than B adds A to B:
£15 less than £80 gives £65.005 less than 20 gives 15£15 more than £80 gives £95.005 more than 20 gives 25the difference between tells you how far apart two amounts are, whichever you write first,
so the answer is never negative:
the difference between £85 and £120 gives £35.00Converting 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:
two and three quarters hours in minutes gives 165 minthree quarters of 2 kg in g gives 1,500 gCurrency conversions use the European Central Bank’s daily rates, so the answer changes from day to day:
split €120 among 4 in USD gives $35.10Your 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:
share = 25%share of £2,000 gives £500.00The 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:
people = 4split £1480 among 5 people gives £296.00split £1480 among people gives £370.00Hold 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:
floor = 12 m²floor * 2 gives 24 m²paint needed = 12.44 Lpaint needed to 1 dp gives 12.4 LNames 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:
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:
# Dinner outmains = 4 items at £17.50 each gives £70.00wine = 2 bottles at £28 each after 25% discount gives £42.00bill = mains + wine gives £112.00people = 4total = bill with 12.5% tip gives £126.00split total among people gives £31.50Each line reads the way you’d say it out loud. Change people or a price, and the share
updates.