Typinator can do more than just insert text, it can also perform calculations right inside your expansions.
This allows you to create dynamic content such as totals, counters, or even date adjustments automatically.
What are calculations in Typinator?
Calculations in Typinator are written inside double curly braces {{ }} and start with a number sign (#).
{{#count*price}}In this example, Typinator multiplies the variables count and price and inserts the result into your expansion.
Assigning calculated values to variables
You can store a calculated value in a variable using the equals sign (=).
{{total=#count*price}}This assigns the result of the calculation to a variable named total.
You can reuse that value later in the same or another expansion:
{{total}}Formatting numbers
If your calculation produces a decimal number, you can choose how many digits appear after the decimal point.
Just add a colon : and a number.
The total costs are ${{#count*price:2}}If count = 10 and price = 4.99, Typinator will output:
The total costs are $49.90.
Updating variables automatically
You can also use calculations to update variables dynamically, such as keeping a running total.
{{donations=#donations+1}}
Including your donation, we have already received {{donations}} contributions. Thank you!Each time this expansion is used, Typinator increases the donation count by one.
Date and time calculations
Typinator can handle date and time arithmetic using predefined variables like dayDelta.
{{dayDelta=#dayDelta+1}}This moves the date forward by one day.
Combine this with date markers (like {YYYY}-{MM}-{DD}) to automatically show tomorrow’s date or other adjusted values.
Combining calculations with input fields
You can make your expansions interactive by combining calculations with input fields.
This lets Typinator ask for values — for example, quantities or prices — and then calculate the result.
{{count=?Quantity}}
{{price=?Unit Price}}
Total: ${{#count*price:2}}When you trigger this expansion, Typinator will prompt you to enter both numbers and then calculate the total automatically.
Combining calculations with scripts
You can make your calculations even more powerful by using them together with Typinator scripts.
For example, you can create expansions that include currency conversions or other advanced computations using live data.
Visit the “Extensions, extras & more” page to explore scripting examples and downloadable packages.
These examples show how you can combine calculations, input fields, and variables to create smart, automated expansions.
Why use calculations
With calculations in Typinator, you can:
- Automate totals, prices, and counts
- Create date-based content
- Build interactive, data-driven expansions
- Save time by reducing repetitive manual updates
Typinator turns your expansions into dynamic tools that think for you!