Decimal uses tokens to format the number to a set number of decimal places.
0
will always display a digit. #
will only display a digit if it exists.
Liquid tries to convert the input to a number before the filter is applied.
Input
{{ 1.23 | decimal: "0.#" }}
Output
1.2
Input
{{ 1000000 | decimal: "#,###.#" }}
Output
1,000,000
Input
{{ "2" | decimal: "0.00" }}
Output
2.00