{
  "synthetic": true,
  "execution": "Teaching record only; no live integration tested",
  "slug": "catalogue-numeric-sort-tie-break",
  "group": "content-data",
  "title": [
    "Catalogue sorting needs a tie-break rule",
    "商品排序，要先约定同序项目怎么排"
  ],
  "intro": [
    "A product finder can place Pack10 before Pack2 with ordinary string sorting. A locale-aware numeric comparison helps, but equivalent labels still need stable IDs for a predictable order. Commission the exact ordering contract rather than a vague “alphabetical” option.",
    "普通字符串排序可能把Pack10放在Pack2之前。按地区的数字比较有帮助，但等价名称仍须稳定ID决定次序。应验收明确排序规则，而非笼统的“字母顺序”。"
  ],
  "facts": [
    [
      "Intl.Collator supports language-sensitive comparison and a numeric option. Comparison returns a negative, zero or positive number; implementations do not promise only−1 or 1.",
      "Intl.Collator支持按语言比较及numeric选项；结果表示负、零或正，不保证只有−1或1。",
      "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator"
    ]
  ],
  "example": [
    [
      [
        "Pack10(idC), Pack2(idB), Pack1(idA)",
        "en-AU; numeric=true",
        "Pack1, Pack2, Pack10"
      ],
      [
        "Pack10(idC)、Pack2(idB)、Pack1(idA)",
        "en-AU，numeric=true",
        "Pack1、Pack2、Pack10"
      ]
    ],
    [
      [
        "Pack2(idB), Pack02(idA)",
        "Numeric labels may compare equal",
        "Use explicit stableID tie-break; A before B in this policy"
      ],
      [
        "Pack2(idB)、Pack02(idA)",
        "数字标签可能同序",
        "按稳定ID补排序，本规则A在B前"
      ]
    ],
    [
      [
        "Same product list arrives in reverse order",
        "Same locale/options/ID rule",
        "Final order must remain identical"
      ],
      [
        "同商品列表反序到达",
        "语言、选项及ID规则相同",
        "最终顺序应相同"
      ]
    ],
    [
      [
        "Supplier relies on default runtime locale",
        "Locale not recorded",
        "Do not approve cross-environment parity"
      ],
      [
        "供应商依赖运行环境默认地区",
        "没有地区记录",
        "不能验收跨环境一致"
      ]
    ]
  ],
  "steps": [
    [
      "Choose locale, numeric handling, case/accent sensitivity and a stable tie-break key. Sorting and search matching are independent policies.",
      "选择地区、数字、大小写及重音敏感度，并指定稳定补排序键；排序与搜索匹配是独立规则。"
    ],
    [
      "Run the supplied list in normal and reversed input order. Compare exact ordered IDs, not only visible labels or the sign magnitude of a comparator.",
      "分别用原序及反序运行列表，比较精确ID顺序，不只看名称或比较值的绝对数值。"
    ],
    [
      "Record runtime/ICU versions and repeat on supported environments with actual bilingual catalogue labels. Locale rules may differ; do not promise one culturally neutral global order.",
      "记录运行环境与ICU版本，用真实双语名称在支持环境重测；地区规则有差异，不承诺文化中立的统一全球顺序。"
    ]
  ],
  "result": [
    "The first row fixes the2/10 defect. The second addresses an additional problem that numeric comparison alone does not solve: two labels can compare equal. A stable ID makes input arrival order irrelevant under this declared policy.",
    "首行解决2与10的错序；第二行解决数字比较本身无法解决的等价名称问题。稳定ID可使本规则不受输入到达顺序影响。"
  ],
  "accept": [
    "Require the exact agreed ID sequence under both input orders and documented runtime settings. No unexplained resorting after pagination or refresh.",
    "两种输入顺序须得出约定ID序列，并记录环境设置；翻页或刷新后不得无解释地重排。"
  ],
  "limit": [
    "Synthetic English SKU labels, not a claim about every Chinese collation rule or a live search index. This does not change existing site search.",
    "合成英文SKU名称，不代表所有中文排序或真实搜索索引；不改既有站内搜索。"
  ],
  "oldLinks": []
}
