Writing Custom Functions in Numi: A Practical Guide


The quick version: Variables in Numi live inside one document. Custom functions, a paid-tier feature, go further: define a formula once with named inputs, and call it by name in any document afterward, the way a spreadsheet formula works but written as a readable line instead of a cell reference. Three practical functions, ready to copy, are below.

Variables versus functions

A variable holds one value for one document: “rate = $85” only means something inside the document where it’s defined. A function is a formula with inputs that stays defined and reusable across sessions, so a tip calculation or a discount formula you build once doesn’t need to be rebuilt every time you open a new document. This is the actual distinction worth understanding before deciding whether the paid tier is worth it for your workflow.

Writing a first function

Start with something genuinely repetitive: a tip calculator that takes a bill amount and a percentage. Define the function with named inputs rather than hardcoded numbers, so it works for any bill you throw at it afterward. In the Numi app, that looks conceptually like:

tip(amount, percent) = amount × percent

tip(85, 20%)
tip(142, 18%)

Each call returns the tip for that specific bill, using the same formula both times without retyping the multiplication logic.

Three functions worth building

A discount calculator

discount(price, percent) = price – (price × percent)

discount(89, 20%)
discount(450, 15%)

Every discounted price calculation across every document afterward becomes one short call instead of rewriting the subtraction each time.

A freelance quote formula

quote(hours, rate, flat_fee) = (hours × rate) + flat_fee

quote(12, 75, 60)
quote(8, 95, 40)

This turns the freelance quoting pattern covered elsewhere on this site into a single reusable call, useful the moment you’re quoting several projects in the same week and don’t want to rebuild the same three-line formula for each one.

A reverse VAT extractor

net_from_total(total, rate) = total / (1 + rate)

net_from_total(91.80, 8%)

The reverse tax formula, which is easy to get wrong when derived from memory under time pressure, becomes a single trusted call once it’s built correctly a single time.

Calling a function with different values

Once defined, a function behaves like any other line: swap in different numbers and the result recalculates instantly. This is the actual time savings compared to variables — a variable-based calculation still needs its formula rebuilt in a new document, while a saved function is available immediately without redefinition.

When a function is overkill

Not every calculation deserves to become a function. A one-off calculation you’ll never repeat is faster written directly as a line than wrapped in a formal function definition. Functions earn their setup cost specifically for patterns you’ll reuse across many documents or many months — a recurring quote structure, a standard tax calculation, a formula you’d otherwise be re-deriving from memory each time and risking a mistake.

Keeping functions simple

Resist the urge to build one enormous function that tries to handle every edge case. The Numi calculator‘s function system is built around straightforward, single-purpose formulas with clearly named inputs. A handful of small, well-named functions — tip, discount, quote, net_from_total — is more reliable and easier to remember than one function with six optional parameters trying to cover every scenario at once.

Frequently asked questions

Do custom functions require the paid version?

Yes. Custom functions are part of Numi’s paid tier. The free version supports variables within a single document, but reusable named functions require the one-time license.

Can a Numi function call another function?

Functions are built around straightforward formulas with named inputs. For most everyday use, keeping each function self-contained is more reliable than nesting functions inside one another.

Are custom functions available across all my documents?

Yes. Saved functions remain available for reuse rather than needing to be redefined in every new document, which is the main advantage over a plain variable.

Previous ArticleNext Article

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *