at_most

Cap a number to a specified maximum value, preventing results from exceeding an upper numerical ceiling.

Syntax

{{ number | at_most: max_value }}

Example

{% assign days = 45 %}{{ days | at_most: 30 }} days maximum

Output

30 days maximum

The at_most filter caps a numerical value to a designated upper limit. If the input exceeds the specified ceiling, the filter returns the ceiling value, protecting layouts from oversized numbers and unrealistic figures.

On programmatic landing pages, at_most constrains promotional figures such as discount percentages or warranty durations. For example: {{ row.raw_discount | at_most: 50 }}% maximum savings. This prevents user-submitted CSV errors or extreme outlier calculations from displaying inflated promotional promises to prospective buyers.

Try this syntax in the editor.