Z16165

{
    "Z1K1": "Z2",
    "Z2K1": {
        "Z1K1": "Z6",
        "Z6K1": "Z16165"
    },
    "Z2K2": {
        "Z1K1": "Z14",
        "Z14K1": "Z16093",
        "Z14K3": {
            "Z1K1": "Z16",
            "Z16K1": "Z610",
            "Z16K2": "def Z16093(Z16093K1):\r\n    \"\"\"\r\n    This function converts a number to its French representation.\r\n    It would definitely break for super large numbers which have no\r\n    corresponding representation. Add more elements to \"orders\"\r\n    if you want it to work for larger numbers (eventually you'll\r\n    get a stack overflow or timeout though).\r\n    \"\"\"\r\n    if Z16093K1 == 0:\r\n        return \"zéro\"\r\n    \r\n    if Z16093K1\u003E999999999999999999999999999999999999999:\r\n        Wikifunctions.Error(\"Z28307\",[str(Z16093K1),\"999999999999999999999999999999999999999\", \"fr\"])\r\n\r\n    units = [\"zéro\", \"un\", \"deux\", \"trois\", \"quatre\", \"cinq\", \"six\", \"sept\", \"huit\", \"neuf\"]\r\n    teens = [\"dix\", \"onze\", \"douze\", \"treize\", \"quatorze\", \"quinze\", \"seize\", \r\n             \"dix-sept\", \"dix-huit\", \"dix-neuf\"]\r\n    tens = [\"\", \"dix\", \"vingt\", \"trente\", \"quarante\", \"cinquante\", \"soixante\", \r\n            \"soixante\", \"quatre-vingt\", \"quatre-vingt\"]\r\n    \r\n    orders = [\"\", \"mille\", \"million\", \"milliard\", \"trillion\", \"quadrillion\", \r\n              \"quintillion\", \"sextillion\", \"septillion\", \"octillion\", \r\n              \"nonillion\", \"decillion\", \"undecillion\"]\r\n\r\n    def convert_hundreds(n):\r\n        if n == 0:\r\n            return \"\"\r\n        elif n \u003C 10:\r\n            return units[n]\r\n        elif n \u003C 20:\r\n            return teens[n - 10]\r\n        elif n \u003C 100:\r\n            if n % 10 == 0:\r\n                if n == 70:\r\n                    return \"soixante-dix\"\r\n                elif n == 90:\r\n                    return \"quatre-vingt-dix\"\r\n                return tens[n // 10]\r\n            elif n \u003C 70 or 80 \u003C= n \u003C 90:\r\n                if n % 10 == 1:\r\n                    return tens[n // 10] + \"-et-un\"\r\n                return tens[n // 10] + \"-\" + units[n % 10]\r\n            elif n \u003C 80:\r\n                if n % 10 == 1:\r\n                    return \"soixante-et-onze\"\r\n                return \"soixante-\" + teens[n % 10]\r\n            else:\r\n                return \"quatre-vingt-\" + teens[n % 10]\r\n        else:\r\n            if n % 100 == 0:\r\n                return units[n // 100] + \" cents\" if n // 100 \u003E 1 else \"cent\"\r\n            else:\r\n                return units[n // 100] + \" cent \" + convert_hundreds(n % 100) if n // 100 \u003E 1 else \"cent \" + convert_hundreds(n % 100)\r\n\r\n    def convert_large_number(n):\r\n        if n \u003C 1000:\r\n            return convert_hundreds(n)\r\n        \r\n        for order in range(len(orders) - 1, 0, -1):\r\n            order_value = 10 ** (order * 3)\r\n            if n \u003E= order_value:\r\n                major_part = n // order_value\r\n                remainder = n % order_value\r\n                major_part_str = convert_hundreds(major_part)\r\n                remainder_str = convert_large_number(remainder)\r\n                order_name = orders[order]\r\n                \r\n                if order_name == \"mille\":\r\n                    if major_part == 1:\r\n                        major_part_str = \"\"\r\n                    elif major_part % 100 == 0:\r\n                        major_part_str = units[major_part // 100] + \" cent\" if major_part // 100 \u003E 1 else \"cent\"\r\n                    return (major_part_str + \" \" + order_name + (\" \" + remainder_str if remainder else \"\")).strip()\r\n                else:\r\n                    if major_part == 1:\r\n                        major_part_str = \"un\"\r\n                    return (major_part_str + \" \" + order_name + (\" \" + remainder_str if remainder else \"\")).strip()\r\n                \r\n    return convert_large_number(Z16093K1)"
        }
    },
    "Z2K3": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11",
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "French cardinal, python"
            },
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1004",
                "Z11K2": "cardinal en français, en Python"
            },
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1430",
                "Z11K2": "Französische Kardinalzahl in Python"
            }
        ]
    },
    "Z2K4": {
        "Z1K1": "Z32",
        "Z32K1": [
            "Z31"
        ]
    },
    "Z2K5": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11",
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "NB: This function implementation mainly uses the short scale except for \"milliard\" = 10^9"
            },
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1430",
                "Z11K2": "Python-Implementierung der Funktion zur Ausgabe der Französischen Kardinalzahl"
            }
        ]
    }
}