Do quick maths in amount and quantity fields

Type a sum like 250*3 into any amount or quantity and stub works out the answer.

No need to reach for a calculator. Every amount field in stub, and the quantity on a document line, takes a sum as well as a number. Type 250*3, press Enter and the field shows 750.

How it works

  1. Click in an amount or quantity field.
  2. Type a sum, for example 12*450.
  3. Press Enter, press Tab to move on, or click away. stub swaps the sum for its answer.

Only the answer is saved, never the sum. In a form that saves when you press Enter, such as a new item or an invoice line, the first Enter works the sum out so you can check the figure, and the next Enter saves.

After Enter, your cursor sits at the end of the answer, so you can carry on: type +50 and press Enter again.

Where it works

  • Prices on products, services and variants, and on the lines of invoices, quotes, orders, bills and purchase orders.
  • Income and expense amounts, including splits and payments.
  • Debits and credits on a manual journal entry.
  • Opening balances for customers, suppliers, bank accounts and stock.
  • Loans, and the lines of a pay package or payslip.
  • The quantity on any document line, whether it counts units, hours or days.

Fields that hold something other than money or a quantity, such as a percentage, a tax rate or a day of the month, take a plain number only.

What you can type

TypeToExampleAnswer
+Add1200+3501550
-Subtract5000-7504250
* or ×Multiply12*4505400
/ or ÷Divide3450/31150
( )Work this part out first(1200+300)*23000

stub follows the usual order of operations: multiply and divide come before add and subtract, so 100+20*2 is 140. Brackets change the order: (100+20)*2 is 240.

A comma is a decimal point, as it is in every amount field, so 99,50*2 is 199. That means you leave out thousands separators: 1,000*3 reads as 1 × 3. Type 1000*3 instead.

Rounding

stub works the whole sum out first and rounds once, at the end, so 100/3*3 comes to exactly 100. Amounts round to the currency's smallest unit, such as cents: 100/3 is 33.33. Quantities keep up to four decimal places: 1/8 is 0.125.

Everyday examples

  • 3450/3 — split a R3,450 bill three ways.
  • 89,99+45,50+12 — add up a till slip.
  • 450*1,3 — price a R450 cost with a 30% markup.
  • 12*24 in a quantity — 12 boxes of 24.
  • 7,5+8+6,25 in a quantity — hours worked across three days.

If stub can't work it out

Press Enter on a sum stub can't work out and the sum stays in the field, with a short message under it saying what to fix:

  • Finish the sum — it ends on an operator or an open bracket, like 100+ or (5*2.
  • Divide by a number other than zero — the sum divides by 0.
  • Check the sum for a typo — usually two numbers with nothing between them. Write 2*(3+4), not 2(3+4).
  • Positive amounts only — the answer is below zero in a field that only takes positive amounts, such as a price or a payment.
  • Keep it to … or less (or or more) — the answer is outside what the field allows.
  • Whole numbers only — the answer is a fraction in a quantity that counts whole units.

If you click away instead, stub puts back the amount the field held before and tells you, for example Sum not finished followed by the amount it kept. A half-finished sum is never saved.

Tip: a minus at the very start is still a negative number. In a field that takes negatives, such as a journal line, -500 is just minus 500. A minus after a number subtracts.

For more ways to fill in forms quickly, see Work faster with the keyboard.