Skip to content
Log in

points - Liquid Filter Reference

On this page

Description

Formats the input as account points

Property Value
Return Type string
Category numbers

Examples

Default behavior

Small values are formatted with the pts suffix:

```liquid

{{ 12 | points }} ```

Output: 12 pts

Thousands separators are added automatically:

```liquid

{{ 1200 | points }} ```

Output: 1,200 pts

```liquid

{{ 1200000 | points }} ```

Output: 1,200,000 pts

Zero is formatted the same way:

```liquid

{{ 0 | points }} ```

Output: 0 pts

Using points with Liquid objects

Use the filter with current_account_points to display a customer’s loyalty balance:

```liquid

{{ current_account_points.current_balance | points }} ```

Output: 4,750 pts

Display pending (not yet activated) points separately:

```liquid

{{ current_account_points.pending_balance | points }} ```

Output: 200 pts

Use the filter on product pricing to show how many points a product earns or costs:

```liquid

{{ current_product.pricing.earn_points | points }} ```

Output: 150 pts

```liquid

{{ current_product.pricing.points | points }} ```

Output: 1,200 pts

Was this article helpful?

Was this article helpful?