Syntax Guide

Percentages, dollar shorthand, units, and special syntax.

Basics

SyntaxExampleNotes
=x = 42Assign a variable
//// this is a commentComment line
+ - * /2 + 3 * 4Standard arithmetic (order of operations applies)
^2^10Exponentiation
()(2 + 3) * 4Grouping

Percentages

Write percentages naturally:

200 + 15%        // = 230 (adds 15% of 200)
200 * 15%        // = 30  (15% of 200)
tax_rate = 8.5%  // = 0.085

Dollar & unit shorthand

$100        // formatted as dollars
$2.5m       // 2,500,000
450k        // 450,000

Sliders

Add @slider(min, max) to make any variable interactive:

nights = 5  // @slider(1, 14)

Coming soon

More content on date math, unit conversions, and conditional expressions.