Numlex Documentation
Syntax Reference

Percentages

Percent literals, additive vs multiplicative contexts, and every strict phrase pattern — including inverses and 'what %' forms.

Main branch reference after R89 · released versions may differ docs/SYNTAX_REFERENCE.md @ 1ebc752

Percentages are not just values in Numlex — context changes what they mean. 10% is 0.1, but in an additive context 100 + 10% means ten percent of the running left side, and the result keeps its percent-style display.

This page documents percent literals, the strict phrase grammar (of, on, off, inverse what forms, fractions and multipliers), the keyword-shadowing rule, and the operand restrictions that turn mixed currencies and zero bases into visible errors.

Percent literals

A percent literal is p% = p/100. Its meaning depends on context:

  • Additive context — a right-hand “pure” percent is a share of the accumulated left side: 100 + 10% = 110, 110 − 5% = 104.5.
  • Every other context — an ordinary scalar: 200 × 10% = 20, 200 / 10% = 2000.

Results keep their kind when displayed: a percent-kind result shows as 30% rather than 0.3, a multiplier as 1.5x, and a fraction as 1/2.

Keyword shadowing

The phrase grammar uses the keywords of on off is what as a to percent percentage fraction multiple multiplier x. They are case-insensitive.

An active variable or constant with the name of a keyword disables every form that uses it. For example, declaring of = 5 turns off all of-forms on the sheet — the word becomes your value.

Phrase patterns

PatternExampleResultRule
<p>% of <v>15% of 49073.5percent × value; the basis is the rest of the line (15% of 490 + 5 = 74.25, 50% of (10 + 5) = 7.5); a money basis value is allowed
<p>% on <v>15% on 200230v × (1 + p)
<p>% off <v>30% off 200140v × (1 − p)
<v> is <p>% of what100 is 50% of what200v ÷ p (inverse basis)
<v> is <p>% off what100 is 20% off what125v ÷ (1 − p)
<v> is <p>% on what100 is 25% on what80v ÷ (1 + p)
<a> is what % of <b>50 is what % of 20025%a ÷ b as a percent
<a> is what % off <b>140 is what % off 20030%(b − a) ÷ b
<a> is what % on <b>230 is what % on 20015%(a − b) ÷ b
<a> as a % of <b>100 as a % of 80012.5%a ÷ b as a percent
<a> to <b> is what %100 to 130 is what %30%(b − a) ÷ a
<a> to <b> as %100 to 130 as %30%(b − a) ÷ a
<m>x of/on/off <v>1.5x of 20, 1.5x on 20, 1.5x off 2030 / 50 / −10multiplier: of = v·m; on = v·(1+m); off = v·(1−m) — exactly like percents (100% off = 0)
<a>/<b> % (terminal space + %)20/200 %10%turns the preceding division into a percent; 20/200% (no space) is the legacy postfix and gives 10
<p>% as fraction50% as fraction1/2reduced rational fraction
<a>/<b> as fraction2/10 as fraction1/5reduced rational fraction
<d> as %0.25 as %25%decimal → percent
<a> as x of <b>20 as x of 54xratio as a multiplier
<a> to <b> as x10 to 15 as x1.5xratio as a multiplier
20% is 500, what is 75017.5%three-value form: B × L ÷ A
if 500 is 20%, what is 75030%three-value form: A × C ÷ B

Operand rules

The operands are evaluated by the same strict core used elsewhere — named values, currency markers and money names all work.

  • Dividing money in different currencies (50 is what % of 200 where the two values use different currencies) is an error.
  • Dividing by zero is an error.
  • Booleans and currencies are never coerced into numbers here.
  • Zero bases and infinite values are errors.

Found an issue in these docs? Report it on GitHub .