📘 公式リファレンス🔧 リファレンス/フィルター初級
money_without_trailing_zeros フィルター(末尾ゼロなし金額表示)
金額をストア通貨で整形し、小数点以下のゼロを削除して表示する。小数部に 0 でない値がある場合は money フィルターと同じ結果になる。
用途
商品価格が 100 円のときは「100」、1,000.50 円のときは「1,000.50」というように、末尾の 0 を削らない方が見た目がすっきりするコレクションリストやカート内で使う。
設置場所
Liquid テンプレート内で `{{ product.price | money_without_trailing_zeros }}` の形で使う。金額を表示する任意の箇所に貼り付け可能。
注意点
小数部が 0 のみの場合(例: 1,000.00 円)は小数点が消える。小数部に 0 でない値がある場合は money フィルターと動作が同じため、価格帯によって表示が不統一になる可能性がある。必ず複数価格パターンで動作確認する。
仕様
30 行 / json{
"category": "money",
"deprecated": false,
"deprecation_reason": "",
"description": "",
"parameters": [],
"return_type": [
{
"type": "string",
"name": "",
"description": "",
"array_value": ""
}
],
"examples": [
{
"name": "",
"description": "",
"syntax": "",
"path": "/products/health-potion",
"raw_liquid": "{{ product.price | money_without_trailing_zeros }}",
"parameter": false,
"display_type": "text",
"show_data_tab": true
}
],
"summary": "Formats a given price based on the store's [**HTML without currency** setting](https://help.shopify.com/manual/payments/currency-formatting), excluding the decimal separator\n(either `.` or `,`) and trailing zeros.\n\nIf the price has a non-zero decimal value, then the output is the same as the [`money` filter](/docs/api/liquid/filters#money).",
"syntax": "number | money_without_trailing_zeros",
"name": "money_without_trailing_zeros"
}出典・ライセンス
- Repository:
- https://github.com/Shopify/theme-liquid-docs
- License:
- MIT
このコードは Shopify 著作の MIT ライセンスソースです。 原本の著作権は Shopify が保有します。日本語訳は ALSEL によるものです。
関連項目
📘 公式リファレンス🔧 リファレンス/フィルター初級
avatar フィルター(顧客アバター画像HTML生成)
顧客アバターが存在する場合、それを表示する HTML タグを生成するフィルター。customer オブジェクトに対して使用する。
📁 theme-liquid-docs·MIT·19 行
📘 公式リファレンス🔧 リファレンス/フィルター初級
default_errors フィルター(フォーム送信エラーを日本語化)
form.errors の各エラーコードに対応する既定のエラーメッセージを自動生成するフィルター。フォーム送信時の入力値不正や必須項目空白などのエラーを言語別に出力する。
📁 theme-liquid-docs·MIT·19 行
📘 公式リファレンス🔧 リファレンス/フィルター初級
date フィルター(日付を指定形式でフォーマット)
日付値を指定されたフォーマット文字列に従って整形する。フォーマット文字列が空の場合は元の値がそのまま返される。入力が日付に変換できない場合も元の値が返される。
📁 theme-liquid-docs·MIT·19 行
📘 公式リファレンス🔧 リファレンス/フィルター初級
payment_terms フィルター(Shop Pay分割払いバナーを生成)
product フォームまたは cart フォームに対して使用し、Shop Pay の分割払いオプションを表示するための HTML を生成するフィルター。顧客が購入時に分割払いプランを選択できるようにする。
📁 theme-liquid-docs·MIT·19 行
📘 公式リファレンス🔧 リファレンス/フィルター初級
abs フィルター(数値の絶対値を取得)
負の数を正の数に変換する。数値の絶対値(ゼロからの距離)を返すフィルター。
📁 theme-liquid-docs·MIT·30 行
📘 公式リファレンス🔧 リファレンス/フィルター初級
append フィルター(文字列の末尾に追加)
文字列の末尾に別の文字列を連結するフィルター。URL パスの結合やテキストの接尾辞追加に使う。
📁 theme-liquid-docs·MIT·30 行