{
  "synthetic": true,
  "execution": "Teaching record only; no live integration tested",
  "slug": "localised-number-input-parse-policy",
  "group": "content-data",
  "title": [
    "Agree the number format before parsing a quote input",
    "解析报价输入前，先约定数字格式"
  ],
  "intro": [
    "A bilingual quote tool can display numbers beautifully and still misread what a visitor types. The string1,234 means different things under different conventions. Commission an explicit input grammar and confirmation, not an automatic replacement that silently changes its value.",
    "双语报价工具显示数字很漂亮，也可能误读输入。1,234在不同约定下含义不同。应明确输入格式及确认方式，不能靠自动替换悄悄改变数值。"
  ],
  "facts": [
    [
      "Intl.NumberFormat provides locale-sensitive formatting. Its documented formatting API is not a general locale-aware input parser; parsing rules remain an application decision.",
      "Intl.NumberFormat提供按地区显示数字的功能；文档中的格式化API不是通用本地化输入解析器，输入规则仍须由应用明确。",
      "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat"
    ]
  ],
  "example": [
    [
      [
        "Explicit en-AU decimal grammar;1,234.50",
        "Grouping comma, decimal point",
        "1234.50; confirm the parsed value before use"
      ],
      [
        "明确en-AU格式；1,234.50",
        "逗号分组，小数点",
        "1234.50，使用前显示解析结果供确认"
      ]
    ],
    [
      [
        "Explicit de-DE decimal grammar;1.234,50",
        "Grouping point, decimal comma",
        "1234.50 under that declared grammar"
      ],
      [
        "明确de-DE格式；1.234,50",
        "点号分组，逗号小数",
        "按该约定解析为1234.50"
      ]
    ],
    [
      [
        "Unknown input locale;1,234",
        "More than one plausible convention",
        "Ask for clarification; do not assume1234 or 1.234"
      ],
      [
        "输入地区未知；1,234",
        "有多种合理解释",
        "要求澄清，不能擅取1234或1.234"
      ]
    ],
    [
      [
        "en-AU declared;12,34.50",
        "Invalid grouping under this grammar",
        "Reject and retain original input"
      ],
      [
        "声明en-AU；12,34.50",
        "分组不符合本例规则",
        "拒绝并保留原输入"
      ]
    ]
  ],
  "steps": [
    [
      "Specify supported input locales, grouping rules, sign, precision and whether grouping is optional. Keep currency identity separate from numeric punctuation.",
      "规定支持地区、分组、正负号、小数精度及是否允许不分组；币种与标点分开。"
    ],
    [
      "Use all four strings as literal fixtures. Require a visible parsed-value confirmation and an explicit invalid or ambiguous result, without discarding the original.",
      "用四个原始字符串测试；显示解析结果供确认，错误或歧义须明确返回，并保留原文字。"
    ],
    [
      "Compare the stored decimal value with the confirmed value in an isolated test. Test paste and mobile input as well as typed digits; do not infer grammar from browser language alone.",
      "在隔离测试中比较存储十进制值与确认值，测试粘贴及手机输入，不能只靠浏览器语言推断格式。"
    ]
  ],
  "result": [
    "Two different strings intentionally map to the same agreed decimal under two explicit grammars. The unknown-locale row must not share that result by guesswork. Formatting a wrong parsed number consistently only hides the defect; the acceptance record needs the original string and its declared interpretation.",
    "两种字符串在明确规则下映射为同一十进制值，但地区未知行不能靠猜测得到相同结果。错误数值显示得再一致也会掩盖缺陷，回执须保留原文字及解释依据。"
  ],
  "accept": [
    "Accept only the supported grammar and confirmed stored value; ambiguous and malformed inputs must remain unresolved or rejected.",
    "只验收受支持规则及确认后的存储值；歧义与错误输入须保留未明或拒绝。"
  ],
  "limit": [
    "Synthetic quantity/quote inputs, no payment or financial calculation. This does not define a universal parser, every locale or a rounding policy.",
    "合成数量及报价输入，不执行付款或金融计算，也不定义通用解析器、全部地区或舍入规则。"
  ],
  "oldLinks": []
}
