{"title":"finite - Liquid Filter Reference","slug":"finite-filter-reference","url":"https://support.storeconnect.com/articles/finite-filter-reference","url_markdown":"https://support.storeconnect.com/articles/finite-filter-reference.md","subtitle":null,"summary":"Replaces a non-finite number (Infinity or NaN) with a large integer or a value you choose. Use it in a feed so unlimited stock still renders as a valid number in JSON, CSV, or XML.","type":"Developer_Documentation","video_url":"","keywords":"liquid, filters, finite, numbers, infinity, unlimited stock, total_available_to_sell, feeds, storeconnect","last_modified":"2026-11-25T21:09:53+0000","body_markdown":"## Description\n\nReplaces a non-finite number (`Infinity`, `-Infinity`, or `NaN`) with a replacement value, so a feed emitting JSON, CSV, or XML gets a valid number. A finite number, or a value that is not a number, is returned unchanged.\n\nThe usual case is a product's `total_available_to_sell` when there is no limit on what it can sell: stock is not tracked, or the product is backorderable, and no maximum quantity is set. That value is infinite, and it otherwise renders as `null` in JSON but as the literal text `Infinity` in CSV.\n\n| Property | Value |\n|----------|-------|\n| **Return Type** | number |\n| **Category** | numbers |\n\n## Options\n\n| Option | Description |\n|--------|-------------|\n| `replacement` | The value to use for a non-finite number. The default is `2147483647`, a large integer that stands for \"unlimited\". |\n\n## Examples\n\n\n```liquid\n\n{{ 42 | finite }}\n```\n\n\n**Output:** `42`\n\n\n```liquid\n\n{{ product.total_available_to_sell | finite }}\n```\n\n\n**Output:** `2147483647` when the product has no limit on what it can sell, otherwise the quantity.\n\n\n```liquid\n\n{{ product.total_available_to_sell | finite, replacement: 0 }}\n```\n\n\n**Output:** `0` when the product has no limit on what it can sell, otherwise the quantity.\n\nWhen you build a feed row with `set_key`, assign the result first. A filter at the end of a `set_key` chain applies to the whole map, not to the value:\n\n\n```liquid\n\n{%- assign inventory = product.total_available_to_sell | finite -%}\n{%- assign row = row | set_key: \"inventory\", inventory -%}\n```\n"}