Z29382

{
    "Z1K1": "Z2",
    "Z2K1": {
        "Z1K1": "Z6",
        "Z6K1": "Z29382"
    },
    "Z2K2": {
        "Z1K1": "Z14",
        "Z14K1": "Z16093",
        "Z14K3": {
            "Z1K1": "Z16",
            "Z16K1": "Z600",
            "Z16K2": "function Z16093(Z16093K1) {\r\n  /**\r\n   * Converts a number to its French representation.\r\n   * This version handles large numbers up to \"undecillion\" (10^36).\r\n   * Beyond that, an error is thrown.\r\n   */\r\n\r\n  if (Z16093K1 === 0) return \"zéro\";\r\n\r\n  if (Z16093K1 \u003E 999999999999999999999999999999999999999n) {\r\n    throw new Error(`Z28307: Number too large (${Z16093K1}) for French conversion.`);\r\n  }\r\n\r\n  const units = [\"zéro\", \"un\", \"deux\", \"trois\", \"quatre\", \"cinq\", \"six\", \"sept\", \"huit\", \"neuf\"];\r\n  const teens = [\"dix\", \"onze\", \"douze\", \"treize\", \"quatorze\", \"quinze\", \"seize\",\r\n                 \"dix-sept\", \"dix-huit\", \"dix-neuf\"];\r\n  const tens = [\"\", \"dix\", \"vingt\", \"trente\", \"quarante\", \"cinquante\", \"soixante\",\r\n                \"soixante\", \"quatre-vingt\", \"quatre-vingt\"];\r\n\r\n  const orders = [\"\", \"mille\", \"million\", \"milliard\", \"trillion\", \"quadrillion\",\r\n                  \"quintillion\", \"sextillion\", \"septillion\", \"octillion\",\r\n                  \"nonillion\", \"decillion\", \"undecillion\"];\r\n\r\n  function convertHundreds(n) {\r\n    if (n === 0) return \"\";\r\n    if (n \u003C 10) return units[n];\r\n    if (n \u003C 20) return teens[n - 10];\r\n    if (n \u003C 100) {\r\n      if (n % 10 === 0) {\r\n        if (n === 70) return \"soixante-dix\";\r\n        if (n === 90) return \"quatre-vingt-dix\";\r\n        return tens[Math.floor(n / 10)];\r\n      } else if (n \u003C 70 || (n \u003E= 80 \u0026\u0026 n \u003C 90)) {\r\n        if (n % 10 === 1) return tens[Math.floor(n / 10)] + \"-et-un\";\r\n        return tens[Math.floor(n / 10)] + \"-\" + units[n % 10];\r\n      } else if (n \u003C 80) {\r\n        if (n % 10 === 1) return \"soixante-et-onze\";\r\n        return \"soixante-\" + teens[n % 10];\r\n      } else {\r\n        return \"quatre-vingt-\" + teens[n % 10];\r\n      }\r\n    } else {\r\n      if (n % 100 === 0) {\r\n        return (Math.floor(n / 100) \u003E 1 ? units[Math.floor(n / 100)] + \" cents\" : \"cent\");\r\n      } else {\r\n        return (Math.floor(n / 100) \u003E 1\r\n          ? units[Math.floor(n / 100)] + \" cent \" + convertHundreds(n % 100)\r\n          : \"cent \" + convertHundreds(n % 100));\r\n      }\r\n    }\r\n  }\r\n\r\n  function convertLargeNumber(n) {\r\n    if (n \u003C 1000) return convertHundreds(Number(n));\r\n\r\n    for (let order = orders.length - 1; order \u003E 0; order--) {\r\n      const orderValue = BigInt(10) ** BigInt(order * 3);\r\n      if (n \u003E= orderValue) {\r\n        const majorPart = n / orderValue;\r\n        const remainder = n % orderValue;\r\n        const majorPartStr = convertHundreds(Number(majorPart));\r\n        const remainderStr = remainder \u003E 0n ? convertLargeNumber(remainder) : \"\";\r\n        const orderName = orders[order];\r\n\r\n        if (orderName === \"mille\") {\r\n          let partStr = \"\";\r\n          if (majorPart === 1n) {\r\n            partStr = \"\";\r\n          } else if (majorPart % 100n === 0n) {\r\n            const hundreds = majorPart / 100n;\r\n            partStr = hundreds \u003E 1n ? units[Number(hundreds)] + \" cent\" : \"cent\";\r\n          } else {\r\n            partStr = majorPartStr;\r\n          }\r\n          return (partStr + \" \" + orderName + (remainderStr ? \" \" + remainderStr : \"\")).trim();\r\n        } else {\r\n          const partStr = (majorPart === 1n) ? \"un\" : majorPartStr;\r\n          return (partStr + \" \" + orderName + (remainderStr ? \" \" + remainderStr : \"\")).trim();\r\n        }\r\n      }\r\n    }\r\n  }\r\n\r\n  return convertLargeNumber(BigInt(Z16093K1));\r\n}\r\n"
        }
    },
    "Z2K3": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11",
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1004",
                "Z11K2": "cardinal en français, en Javascript"
            },
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "French cardinal, javascript"
            }
        ]
    },
    "Z2K4": {
        "Z1K1": "Z32",
        "Z32K1": [
            "Z31"
        ]
    },
    "Z2K5": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11"
        ]
    }
}