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 maximumOutput
30 days maximumThe 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.
Filters
- abs
- append
- at_least
- at_most
- capitalize
- ceil
- compact
- concat
- date
- default
- divided_by
- downcase
- escape
- escape_once
- first
- floor
- join
- last
- lstrip
- map
- minus
- modulo
- newline_to_br
- plus
- prepend
- remove
- remove_first
- replace
- replace_first
- reverse
- round
- rstrip
- size
- slice
- sort
- sort_natural
- split
- strip
- strip_html
- strip_newlines
- times
- truncate
- truncatewords
- uniq
- upcase
- url_decode
- url_encode
- where
- raw
- slugify
- number_format
