--- title: "Calculations in Liquid Markup" slug: "calculations-in-liquid-markup" status: "new" updated: 2026-07-21T20:17:53Z published: 2026-07-21T20:17:53Z canonical: "knowledge.technolutions.net/calculations-in-liquid-markup" stale: true --- > ## Documentation Index > Fetch the complete documentation index at: https://knowledge.technolutions.net/llms.txt > Use this file to discover all available pages before exploring further. # Calculations in Liquid Markup [Liquid markup](/v1/docs/getting-started-with-liquid-markup) can perform simple calculations in messages, letters, and portals. When the source value comes from a query export, confirm that Liquid treats the value as a number before applying a math filter. > [!TIP] > ⭐ Get Inspired > > This article was adapted from [a post by Technolutions staff](https://community.technolutions.net/get-inspired/post/mathematical-calculations-liquid-markup-ROcfXLlEDJmrOkD) in the Slate Community Forums' Get Inspired space. Have a great idea for a Get Inspired post? [Let us know](https://community.technolutions.net/get-inspired/new?post_type=gnHx7As1gZ8r6Ld)! ## Example use case A MergePublic query returns an export named `scholarship_amount`. A decision letter can display the yearly amount with this merge field: ```Liquid You have been awarded a scholarship in the amount of ${{scholarship_amount}}. ``` If the scholarship is renewable for four years, the letter may need to calculate the total award. ## Why string values concatenate If Liquid treats the export value as a string, using a whole number in the `times` filter can concatenate the value instead of multiplying it. ```Liquid That is a total of ${{scholarship_amount | times: 4}} over 4 years. ``` For example, a scholarship amount of `15000` may output `15000150001500015000`. ## Force a numeric calculation Use a decimal in the multiplier to force Liquid to treat the value as a number. ```Liquid That is a total of ${{scholarship_amount | times: 4.0}} over 4 years. ``` With a scholarship amount of `15000`, this outputs `60000`. ## Test the rendered output 1. Preview the message, letter, or portal content with a record that has a known value. 2. Confirm that the calculated result is numeric. 3. Apply any required formatting after confirming the calculation itself works. For more information about displaying query exports in decision letters, see [Displaying Custom Fields in Decision Letters: MergePublic Queries](https://knowledge.technolutions.net/docs/displaying-custom-fields-in-decision-letters-mergepublic-queries).