Z31393

{
    "Z1K1": "Z2",
    "Z2K1": {
        "Z1K1": "Z6",
        "Z6K1": "Z31393"
    },
    "Z2K2": {
        "Z1K1": "Z14",
        "Z14K1": "Z15567",
        "Z14K3": {
            "Z1K1": "Z16",
            "Z16K1": "Z600",
            "Z16K2": "function Z15567(Z15567K1) {\r\n\tif (typeof Z15567K1 !== \"bigint\") {\r\n\t\tthrow new TypeError(\"Input must be BigInt\");\r\n\t}\r\n\tif (Z15567K1 === 0n) {\r\n\t\treturn \"sifar\";\r\n\t}\r\n\tconst MAX = 999999999999999999999999999999999999999999999999n;\r\n\tif (Z15567K1 \u003E MAX) {\r\n\t\tthrow new RangeError(\"Number too large\");\r\n\t}\r\n\tconst integers = [\r\n\t\t\"\", \"satu\", \"dua\", \"tiga\", \"empat\",\r\n\t\t\"lima\", \"enam\", \"tujuh\", \"lapan\", \"sembilan\"\r\n\t];\r\n\tconst teens = [\r\n\t\t\"sebelas\", \"dua belas\", \"tiga belas\", \"empat belas\",\r\n\t\t\"lima belas\", \"enam belas\", \"tujuh belas\",\r\n\t\t\"lapan belas\", \"sembilan belas\"\r\n\t];\r\n\tconst tys = [\r\n\t\t\"\", \"sepuluh\", \"dua puluh\", \"tiga puluh\",\r\n\t\t\"empat puluh\", \"lima puluh\", \"enam puluh\",\r\n\t\t\"tujuh puluh\", \"lapan puluh\", \"sembilan puluh\"\r\n\t];\r\n\tconst blocks = [\r\n\t\t\"\", \"ribu\", \"juta\", \"bilion\", \"trilion\",\r\n\t\t\"kuadrilion\", \"kuintilion\", \"sekstilion\",\r\n\t\t\"septilion\", \"oktilion\", \"nonilion\", \"desilion\"\r\n\t];\r\n\r\n\tfunction spellBlock(x) {\r\n\t\tif (x === 0n) return \"\";\r\n\t\tconst parts = [];\r\n\t\tconst hundreds = x / 100n;\r\n\t\tconst rest = x % 100n;\r\n\t\tif (hundreds \u003E 0n) {\r\n\t\t\tparts.push(hundreds === 1n ? \"seratus\" : integers[Number(hundreds)] + \" ratus\");\r\n\t\t}\r\n\t\tif (rest \u003E= 11n \u0026\u0026 rest \u003C= 19n) {\r\n\t\t\tparts.push(teens[Number(rest - 11n)]);\r\n\t\t} else {\r\n\t\t\tconst tens = rest / 10n;\r\n\t\t\tconst ones = rest % 10n;\r\n\t\t\tif (tens \u003E 0n) parts.push(tys[Number(tens)]);\r\n\t\t\tif (ones \u003E 0n) parts.push(integers[Number(ones)]);\r\n\t\t}\r\n\t\treturn parts.join(\" \");\r\n\t}\r\n\tconst result = [];\r\n\tlet temp = Z15567K1;\r\n\tlet i = 0;\r\n\twhile (temp \u003E 0n) {\r\n\t\tconst block = temp % 1000n;\r\n\t\ttemp = temp / 1000n;\r\n\t\tconst text = spellBlock(block);\r\n\t\tif (text) {\r\n\t\t\tif (blocks[i]) {\r\n\t\t\t\tif (text === \"satu\") {\r\n\t\t\t\t\tresult.push(\"se\" + blocks[i]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresult.push(text + \" \" + blocks[i]);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tresult.push(text);\r\n\t\t\t}\r\n\t\t}\r\n\t\ti++;\r\n\t}\r\n\treturn result.reverse().join(\" \");\r\n}"
        }
    },
    "Z2K3": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11",
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "Malay cardinal (se- instead of satu): JS"
            }
        ]
    },
    "Z2K4": {
        "Z1K1": "Z32",
        "Z32K1": [
            "Z31"
        ]
    },
    "Z2K5": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11",
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "Another implementation of Malay cardinal but with se- prefix compared to \"satu\" for unit million and below."
            }
        ]
    }
}