This site describes solve-engine 2.44.0, the version npm installs.
Interest & inflation
Package:
FINANCE_PACKAGE. Registered bycreateEngine(); for a slimmer engine, register it explicitly (see choosing packages).
Interest is what a sum grows by when it is lent or borrowed; inflation is how the value of money changes over the years. Solve works out the interest on a principal, the monthly repayment on a loan, and what a past amount is worth in today’s money.
The principal comes first, then the term and the rate, and a mortgage repayment reads the same way.
interest on 1000 over 3 years at 5% // 157.63monthly repayment on 200000 over 25 years at 4% // 1,055.67The term and the rate read in either order, so at 5% over 3 years says the same
thing as over 3 years at 5%.
interest on gives the interest alone, what the sum has grown by.
compound interest on gives the whole balance at the end, the principal and its
interest together, which is the figure a savings statement shows.
compound interest on 1000 over 3 years at 5% // 1,157.63A rate of -100% or less has no answer: the sum would fall to nothing, or below it, so every one of these forms refuses it, and says so with the rate as you wrote it.
compound interest on 1000 over 3 years at -150% // ERROR: A rate of -150% cannot be used: it must be more than -100%, since at -100% or less the amount falls to nothing or below.Repayments and interest by the period
Section titled “Repayments and interest by the period”A loan is repaid in equal instalments that cover the interest and a share of the
principal. The monthly figure is the one a lender quotes, and the same loan can
be read by the day, by the year, or over its whole life: daily, monthly,
annual or total, before repayment on for what is paid, or before
interest on for the part of it that is interest. Each is worked out from the
same monthly schedule, so the annual repayment is twelve monthly ones and the
total is every payment added up.
daily repayment on 200000 over 25 years at 4% // 34.71monthly repayment on 200000 over 25 years at 4% // 1,055.67annual repayment on 200000 over 25 years at 4% // 12,668.08total repayment on 200000 over 25 years at 4% // 316,702.10daily interest on 200000 over 25 years at 4% // 12.79monthly interest on 200000 over 25 years at 4% // 389.01annual interest on 200000 over 25 years at 4% // 4,668.08total interest on 200000 over 25 years at 4% // 116,702.10A repayment is often just called a payment, and payment on reads the same way
as repayment on for each of the four periods: daily payment on, monthly payment on, annual payment on and total payment on.
monthly payment on $200,000 over 25 years at 4% // $1,055.67total payment on 200000 over 25 years at 4% // 316,702.10Only the three words together are claimed, so a variable named payment still
works on its own and beside the phrase:
payment = monthly payment on 200000 over 25 years at 4% // 1,055.67payment * 12 // 12,668.08The total interest is what the loan costs: the total repaid less the 200,000 borrowed. The periodic interest figures are that cost spread evenly, an average over the term, not the interest in any one month (early payments are mostly interest, late ones mostly principal).
How often interest compounds
Section titled “How often interest compounds”Compounding is how often the interest earned so far is added to the sum, so
that it earns interest of its own. The more often that happens, the more a
year’s rate grows the sum. Interest compounds once a year unless the line says
otherwise; a compounding tail names another interval.
interest on 1000 over 3 years at 5% compounding annually // 157.63interest on 1000 over 3 years at 5% compounding quarterly // 160.75interest on 1000 over 3 years at 5% compounding monthly // 161.47interest on 1000 over 3 years at 5% compounding daily // 161.82The intervals read are annually (or yearly), semi-annually (or
semiannually and half-yearly), quarterly, monthly, fortnightly,
weekly and daily, and a day is a 365th of a year. The tail may also be
written compounded, the commoner English.
interest on 1000 over 3 years at 5% compounding semi-annually // 159.69interest on 1000 over 3 years at 5% compounded monthly // 161.47A monthly
repayment is already worked out month by month, with the yearly rate divided by
twelve, the way a lender quotes it, so it takes no compounding tail.
The boundary: biannually is not read, since some readers take it to mean
every two years rather than twice a year, and nor is the two-word twice yearly. A line using either is refused rather than guessed at.
A term shorter than a year
Section titled “A term shorter than a year”The term carries its unit, so a short-dated facility or a late invoice is written the way it is quoted rather than converted by hand first.
interest on £2,400 over 45 days at 8% // £22.88interest on £2,400 over 18 months at 8% // £293.69monthly repayment on £200,000 over 300 months at 4.5% // £1,111.66Two conventions, both worth stating because they are conventions rather than
calendar arithmetic. A month is a twelfth of a year, so 18 months is a year
and a half and a 300-month mortgage is a 25-year one, which is what a lender
means by those words. Everywhere else in the engine a month is thirty days, so
18 months in years answers 1.48; a term is the deliberate exception.
Everything else converts against a 365-day year, so a 45-day term is the
same whether those days fall in February or March.
A term that is not a length of time is refused rather than read as a number of years, since a term in kilograms is a mistake and not a quantity.
A bare number is still years, which is what the forms above use.
interest on 1000 at 5% over 3 years // 157.63monthly repayment on 200000 at 4% over 25 years // 1,055.67The function forms
Section titled “The function forms”Each phrase has a function spelling as well, for a line built from other values or copied from a spreadsheet. The arguments are the principal, the rate and the term in years, in that order.
compoundInterest(principal, rate, years)is the balance at the end, andinterestEarned(principal, rate, years)the interest alone.compoundInterestRate(principal, balance, years)finds the yearly rate that grows one into the other, andcompoundInterestYears(principal, balance, rate)how many years it takes.monthlyPayment(principal, rate, years)is a loan’s monthly repayment.loanRepaymentandloanInteresttake a fourth argument, the payments per year the answer is given for (12 for monthly, 1 for yearly), and give the repayment and the interest in it the way the phrases above do.
compoundInterest(1000, 5%, 3) // 1,157.63interestEarned(1000, 5%, 3) // 157.63compoundInterestRate(1000, 1157.63, 3) // 5.00%compoundInterestYears(1000, 1157.63, 5%) // 3.00monthlyPayment(200000, 4%, 25) // 1,055.67loanRepayment(200000, 4%, 25, 12) // 1,055.67loanInterest(200000, 4%, 25, 12) // 389.01The spreadsheet functions pmt, fv and npv are not read under those names.
A spreadsheet’s PMT takes the rate per period, the number of periods and the
principal, in that order, and a call spelled the same way that read its
arguments in another order would give a wrong answer without saying so. Inside
a call, a comma also separates arguments, so write a principal without thousands
separators there (200000, not 200,000). Cash flows have their own phrase,
npv of (see cash flow).
The return on an investment
Section titled “The return on an investment”A return is what an investment gained, measured against what went in: $1,000
that became $1,500 made a 50% return. Every way of asking answers a percentage,
so the answers compare and combine with each other. invested ... returned
gives the whole gain; annual return on and compoundInterestRate give the
yearly rate that, compounded, turns the one amount into the other.
$1,000 invested $1,500 returned // 50.00%$500 invested $1,500 returned // 200.00%annual return on $1,000 invested $1,500 returned after 3 years // 14.47%compoundInterestRate($1,000, $1,500, 3) // 14.47%The whole gain is the profit against the cost, not the money multiple: tripling
your money is a 200% return. For the multiple, divide ($1,500 / $500 is 3), or
ask for the return as multiplier, which is 3x.
The function forms take amounts written the usual way, thousands commas included: inside the brackets of a call, a comma after an amount with a currency sign and before exactly three digits groups the thousands (see amounts inside a call).
compoundInterest($1,000, 5%, 3) // $1,157.63Inflation
Section titled “Inflation”Inflation adjusts an amount into another year’s money: what is $100 from 1990
asks what $100 in 1990 is worth now. The figures come from a consumer price
index, a record of what a typical basket of shopping cost in each year, so the
ratio of two years’ figures says how much more money buys the same things. Each
country’s index records its own prices, so the amount’s currency picks the
index: US dollars read the US index, pounds sterling the UK one and euros the
euro-area one. The indices are bundled with the engine, so no line needs the
network.
what is $100 from 1990 // $253.39inflationAdjust($100, 1990, 2020) // $198.02what is $500 in 1990 worth in 2010 // $834.19The first line runs to the current year, so its answer moves on each January; the other two name both years.
what was $500 worth in 1965 runs the other way: it takes $500 of today’s money
and says what the same buying power came to in 1965, when prices were lower.
$100 in 1965 dollars asks the same question in fewer words, and £100 in 1990 pounds and €100 in 2010 euros ask it of pounds and euros, each through its
own index (the singular pound, dollar and euro work too).
what was $500 worth in 1965 // $47.56$100 in 1965 dollars // $9.51£100 in 1990 pounds // £30.53The amount can be worked out on the line: what is $100 * 2 from 1990 adjusts
$200, and what is $300 + $50 from 2003 adjusts $350, the same as the
bracketed ($300 + $50). Everything between what is and from (or in, or
worth in) is the amount, so a + or - there joins two amounts, since the
year can only come after one of those words.
what is $100 * 2 from 1990 // $506.78what is $300 + $50 from 2003 // $629.96what is ($300 + $50) from 2003 // $629.96what is $300 + $50 in 1990 worth in 2010 // $583.93Only a sign joins amounts. A word between them is not read as a sum, so and
is refused, and the refusal points at the plus sign:
what is $300 and $50 from 2003 // ERROR: an inflation question names its year straight after the amount, as in what is $300 from 2003 or what is $300 in 1990 worth in 2010, and here "and" comes after the amount: to adjust a total, join the amounts with a plus sign, as in what is $300 + $50 from 2003The year
Section titled “The year”The year is a plain whole number, the way a calendar writes it: 1990, or a
name that holds one. It is a single number, so an operator written after it
belongs to the line rather than to the year: what is $100 from 1990 + $5
adjusts $100 from 1990 and then adds $5 to the answer, the same way $100 in 1990 dollars + $5 and 5 km in m + 3 m add to theirs. A year worked out from a
sum goes in brackets, from (1990 + 5).
what is $100 from 1990 + $5 // $258.39what is $100 from (1990 + 5) // $217.31year = 1990 // 1,990what is $100 from year // $253.39A year that is not a plain whole number is refused by name rather than read for
whatever number it holds. Before this, from $1990 was the year 1990, from 1990 + $5 was 1995 with the money added to the year, and from 1990.5 was
looked up as 1990, each answered with a confident figure. Money, a quantity, a
date and a fraction are all refused the same way, in every inflation form,
inflationAdjust(...) included.
what is $100 from 1990.5 // ERROR: the year of an inflation question is a plain whole number, such as 1990, and 1990.5 is not a whole numberwhat is $100 from $1990 // ERROR: the year of an inflation question is a plain whole number, such as 1990, and this one is moneywhat was $100 worth in 1990 kg // ERROR: the year of an inflation question is a plain whole number, such as 1990, and this one is a massThe boundary: a whole number is a year even when no index covers it, so from -1990 and from 1e9 are refused by the index, which names the years it holds
(see below), not by this rule. Between two named years the first is followed by
worth in, so a sum written there is refused with a pointer at the brackets
rather than read as part of the year.
what is $100 in 1990 + 5 worth in 2010 // ERROR: an inflation question between two years reads what is <amount> in <year> worth in <year>, and here "+" comes after the first year: a year is one number or name, so a year worked out goes in brackets, as in (1990 + 5)what is $100 in (1990 + 5) worth in 2010 // $143.08Which index answers each currency
Section titled “Which index answers each currency”Three indices are bundled, one for each currency below, and each covers only the years its publisher has figures for.
| Currency | Index | Years |
|---|---|---|
US dollars ($, USD) | US CPI-U, series CUUR0000SA0 from the Bureau of Labor Statistics | 1913 to 2026 |
Pounds sterling (£, GBP) | ONS series CDKO, the long-term indicator of prices of consumer goods and services | 1800 to 2026 |
Euros (€, EUR) | Eurostat’s HICP (harmonised index of consumer prices) for the euro area | 1999 to 2025 |
Every table is built ahead of time by a script in the repository from the published series, and its source and the date it was retrieved are written at the top of the table’s file.
US dollars. The index is the United States CPI-U (the consumer price index for all urban consumers, US city average, all items), series CUUR0000SA0 from the Bureau of Labor Statistics. Each year is the average of its twelve monthly figures, worked out the way BLS works out its own annual average, and the table runs from 1913, the first year of the series, to the current year. Two years are not a full twelve months:
- 2025 has eleven: October 2025 was never collected, during the 2025 lapse in US government funding. Its figure is the average of the other eleven, which is the 321.943 BLS published.
- The current year is partial: it averages the months published so far (January to July 2026 in this build), so an answer that reads it moves a little each time the table is rebuilt.
Pounds sterling. The UK has several price indices (CPI, CPIH and RPI), and none of them on its own reaches back before the Second World War. The bundled one is ONS series CDKO, the long-term indicator of prices of consumer goods and services (January 1974 = 100). CDKO is the ONS’s own long-run consumer price series, which chains RPI-era data before the CPI’s start, so a single series runs from 1800 to now. It is none of CPI, CPIH or RPI on its own, so an answer here can differ a little from one worked out with any one of them. Each year is the annual figure ONS publishes, and the current year is partial, the average of the months published so far (January to July 2026 in this build).
what is £100 from 1990 // £327.52what was £500 worth in 1965 // £17.92inflationAdjust(£100, 1990, 2020) // £232.44Euros. The euro-area index is Eurostat’s HICP (the harmonised index of consumer prices, the measure the European Central Bank targets) for the euro area as its membership changed, taken from the ECB’s monthly series ICP.M.U2.N.000000.4.INX. Each year is the average of its twelve months, which is how Eurostat works out its own annual average.
inflationAdjust(€100, 2000, 2020) // €138.15what is €100 in 1999 worth in 2025 // €172.87The euro has two boundaries of its own. The index starts in 1996, but the euro
began in 1999, so a euro amount from before 1999 would be a sum in francs, marks
or lire converted at a rate fixed afterwards: those years are refused with the
reason. And the series ends with 2025: the ECB discontinued it in February 2026,
when Eurostat changed how the HICP is compiled, and its replacement is a
different series, which is not joined on. So a euro line that runs to the
current year is refused, €100 in 2010 euros included, since it starts from
today’s money; naming both years, as inflationAdjust does, answers.
what is €100 from 1990 // Year 1990 is before the euro began in 1999, so there is no amount in euros from then to adjust (the euro-area price index itself starts in 1996)what is €100 from 2000 // Year 2026 is outside the bundled euro-area price index's range (1999-2025): the series it is built from ends with 2025, so name a year up to 2025 to adjust to€100 in 2010 euros // Year 2026 is outside the bundled euro-area price index's range (1999-2025): the series it is built from ends with 2025, so name a year up to 2025 to adjust toYears and amounts an index cannot read
Section titled “Years and amounts an index cannot read”A year outside an index is refused rather than extrapolated, since a year before a series began has no figure, and a year after the latest has a forecast at best. The refusal names the index and its range:
what is $100 from 1912 // Year 1912 is outside the bundled CPI table's range (1913-2026)what is £100 from 1799 // Year 1799 is outside the bundled UK price index's range (1800-2026)An amount in any other currency is refused rather than adjusted by another
country’s prices with its own currency sign. So is a quantity that is not money,
and so is a bare number, which names no currency for an index to be chosen by.
An amount converted into a currency first, such as ($100 in GBP), is in that
currency, so it reads that currency’s index.
what is ¥100 from 1990 // no price index for JPY is bundled, so there is no record of what it bought in another year: only an amount in US dollars, pounds sterling or euros, such as $100, £100 or €100, can be adjustedwhat is 100 from 1990 // a price index measures one currency, and this amount has none: write it with its currency, in US dollars, pounds sterling or euros, such as $100, £100 or €100A word straight after the number stands where a currency would, so what is 100 apples from 1990 is refused by that word: apples are not money. To adjust a
price held in a name, write the multiplication out, what is 100 * apples from 1990, which reads the name’s value. pounds on its own is the weight, as in 5 kg in pounds, so an amount of money in pounds is written £100 or 100 GBP,
and the refusal says so.
what is 100 apples from 1990 // a price index adjusts money, and apples is not a currency: give an amount in US dollars, pounds sterling or euros, such as $100, £100 or €100what is 100 pounds from 1990 // a price index adjusts money, and pounds is a mass: give an amount in US dollars, pounds sterling or euros, such as $100, £100 or €100 (for pounds sterling, write £100 or 100 GBP)in 1965 dollars names the currency it answers in, so it takes an amount in
dollars only, and in 1990 pounds and in 1990 euros likewise take pounds and
euros only: the line asks for one currency, and an amount in another would need
a conversion and an adjustment at once. what was £100 worth in 1965 reads any
currency’s own index.
£100 in 1990 dollars // in 1990 dollars asks for US dollars, and this amount is in GBP: ask what it was worth in 1990 instead, which reads the UK price index (ONS CDKO)$100 in 1990 pounds // in 1990 pounds asks for pounds sterling, and this amount is in USD: ask what it was worth in 1990 instead, which reads the US consumer price index (BLS CPI-U)value of £100 in 2030 assuming 3% inflation is a different question: it states
the rate rather than reading an index, so it takes any currency. It answers what
the amount will buy in that year if prices rise by the rate each year, which is
less than the amount: the money is divided by the growth in prices, once for
each year from now. A rate of 0% leaves it as it is.
value of $100 in 2030 assuming 3% inflation // $88.85value of £100 in 2030 assuming 3% inflation // £88.85value of $100 in 2030 assuming 0% inflation // $100.00Its year is read as every other inflation form reads one: a plain whole number, so a fraction, money, a quantity or a date there is refused with the same words rather than read for its number.
value of $100 in 2030.5 assuming 3% inflation // ERROR: the year of an inflation question is a plain whole number, such as 1990, and 2030.5 is not a whole numbervalue of $100 in $2030 assuming 3% inflation // ERROR: the year of an inflation question is a plain whole number, such as 1990, and this one is moneyThe figures are the published indices, but an adjustment by one is still an average over a typical basket of shopping, not what any one price did. For a contract, a tax figure or a cost-of-living clause, use the series from its publisher directly: bls.gov/cpi, ons.gov.uk, or Eurostat.