Numlex Documentation
Syntax Reference
Report issue

Answer tokens

How live tokens are created and used: insertion rules, supported answers, unit conversion, copying and precision limits.

An answer token is a live reference to another line: double-click an answer, and a token appears that always shows that line’s current value. Tokens link to the source line, not to a copy of its text, so they survive edits and renames.

This page covers creation (including the automatic previous-answer path), insertion rules, exactly which answer kinds can be tokenized, unit conversion with tokens, copy behavior, the Line N fallback when a source disappears, and the precision limits of mixed token arithmetic.

Creating a token

Double-click an answer line. Double-click tokenizes:

  • .number answers — including quantities with units, and the percent/multiplier/fraction display kinds;
  • built-in sum lines (they tokenize as an ordinary dimensionless number);
  • named values (.variable, including integer ones);
  • money sums (.money).

Boolean, date, geo and DMS answers are never tokenized. There is no Insert token item in the context menu, and no ⌘ command for it.

There is also a separate automatic path: when a new line starts with an operator, the app inserts the previous answer’s token by itself. That path additionally accepts exact .integer values — which double-click does not tokenize.

A token stores a live reference to the source line (not its text), so it survives renaming and editing.

Insertion rules

  • Cursor or selection on a line other than the source: the marker is inserted at the cursor; a non-empty selection is replaced by the marker.
  • Cursor or selection on the source line itself: to avoid a circular self-reference, the marker lands on a new logical line immediately after the whole source line.
  • Duplicates are allowed: as many tokens as you like may point at the same answer.

Token behavior

  • Live link: whenever the source recalculates, every occurrence of its token updates.
  • Broken link: if the source line is deleted, the token shows Line N as unavailable.
  • Supported result kinds: numbers (scalar/percent/multiplier/fraction, and quantities with units; built-in sum lines are an ordinary dimensionless number), named values, exact integers (the base representation is preserved) and money sums (the token carries the ISO currency code). Booleans, dates, geo and DMS results are not tokenized.
  • Unit conversion: <token> to <unit> — the token inherits the quantity and converts like an ordinary quantity.
  • Copying: a token copies as the answer (number/unit), not as the marker.
  • Local display: a source’s local display override does not change the token’s global format — the token renders by its own/global format, not by the source’s local override.
  • Exact integers: the token displays and copies the source’s exact base label. Mixed token arithmetic falls back to ordinary floating-point values, so precision above 2^53 cannot be relied on. Bitwise operations directly on a token are not supported yet.

Found an issue in these docs? Report it on GitHub