Пређи на садржај

Модул:number list/data/th

Документацију овог модула можете да направите на страници Модул: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 = "[[ที่]]ศูนย์<q:rare, computing>",
	multiplier = "ศูนย์[[เท่า]]<q:rare, computing>",
}

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

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

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

numbers[4] = {
	cardinal = "สี่",
	fractional = "เสี้ยว<q:dated>",
}

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] .. "สิบหนึ่ง<q:rare, military>")
	end
	if t == 2 then
		table.insert(numbers[n].cardinal, "ซาว" .. ones[o + 1] .. "<q:dialectal>")
	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