Module:number list/data/th

local export = {numbers = {}}

local numbers = export.numbers

export.numeral_config = { zero_codepoint = 0x0E50, -- ๐, THAI DIGIT ZERO thousands_separator = ",", }

numbers[0] = { cardinal = "ศูนย์", ordinal = "ที่ศูนย์", multiplier = "ศูนย์เท่า", }

numbers[1] = { cardinal = "หนึ่ง", }

numbers[2] = { cardinal = "สอง", fractional = {"ครึ่ง", "ซีก"}, collective = "คู่" }

numbers[3] = { cardinal = "สาม", }

numbers[4] = { cardinal = "สี่", fractional = "เสี้ยว", }

numbers[5] = { cardinal = "ห้า", }

numbers[6] = { cardinal = "หก", collective = "ครึ่งโหล" }

numbers[7] = { cardinal = "เจ็ด", }

numbers[8] = { cardinal = "แปด", }

numbers[9] = { cardinal = "เก้า", }

local tens = {"", "ยี่", "สาม", "สี่", "ห้า", "หก", "เจ็ด", "แปด", "เก้า"} local ones = {"", "เอ็ด", "สอง", "สาม", "สี่", "ห้า", "หก", "เจ็ด", "แปด", "เก้า"}

local t, o for n = 10, 99 do	t, o = math.floor(n / 10), n % 10 numbers[n] = { cardinal = { tens[t] .. "สิบ" .. ones[o + 1] } } if o == 1 then table.insert(numbers[n].cardinal, tens[t] .. "สิบหนึ่ง") end if t == 2 then table.insert(numbers[n].cardinal, "ซาว" .. ones[o + 1] .. "") end end

-- ipairs skips 0 for _, num in ipairs(numbers) do num.ordinal = { "ที่" .. (num.cardinal[1] or num.cardinal) } num.multiplier = { (num.cardinal[1] or num.cardinal) .. "เท่า" } end

-- last adjustment numbers[12].collective = "โหล" --numbers[144].collective = "กุรุส" table.insert(numbers[1].ordinal, "แรก") table.insert(numbers[2].ordinal, "รอง")

return export