number - Liquid Filter Reference
On this page
Description
Formats the input as a number according to the locale
| Property | Value |
|---|---|
| Return Type | string |
| Category | numbers |
Options
| Option | Description |
|---|---|
compact |
Removes insignificant zeros after the decimal separator. Default: “true” unless precision is specified. |
delimiter |
Sets the thousands delimiter. Default: “” |
separator |
Sets the separator between the fractional and integer digits (defaults to “.”) |
precision |
Defines the number of decimal places |
Examples
liquid
{{ 12 | number }}
Output: 12
liquid
{{ 12.768 | number }}
Output: 12.768
liquid
{{ 12.7689 | number }}
Output: 12.769