This module contains data on various types of numbers in เควนยา.

จำนวน เลข เชิงการนับ เชิงอันดับที่ เชิงกริยาวิเศษณ์ เศษส่วน (⅟…)
0 ð munta
1 ñ min minya ellumë
2 ò atta attëa yullumë peresta
3 ó neldë neldëa nellumë nelesta
4 ô canta cantëa cantallumë canasta
5 õ lempë lempëa lempellumë lepesta
6 ö enquë enquëa enquellumë enquesta
7 ÷ otso otsëa otsollumë otosta
8 ø toldo toldëa toldollumë tolosta
9 ù nertë nertëa nertellumë neresta
10 GðGñG quëan quainëa quëallumë quaista
11 GñGñG minquë minquëa minquellumë minquesta
12 GòGñG yunquë yunquëa yunquellumë yunquesta
13 GóGñG nelquë nelquëa
14 GôGñG canquë canquëa
15 GõGñG lepenquë lepenquëa
16 GöGñG enenquë enenquëa
17 G÷GñG otoquë otoquëa
18 GøGñG tolquë tolquëa
19 GùGñG neterquë neterquëa
20 GðGòG yuquain
30 GðGóG nelquain
40 GðGôG canquain
50 GðGõG lepenquain
60 GðGöG enquain
70 GðG÷G otoquain
80 GðGøG tolquain
90 GðGùG neterquain
100 GðGðGñG tuxa tuxasta
1,000 GðGðGðGñG húmë, tuxainen
10,000 GðGðGðGðGñG quaihúmë
1,000,000 (106) GðGðGðGðGðGðGñG mindórë
1,000,000,000 (109) GðGðGðGðGðGðGðGðGðGñG yundórë

local export = {}

local numbers = {}
export.numbers = numbers

numbers[0] = {
	cardinal = "munta"
}
numbers[1] = {
	cardinal = "min",
	ordinal = "minya",
	adverbial = 'ellumë'
}
numbers[2] = {
	cardinal = "atta",
	ordinal = "attëa",
	adverbial = 'yullumë',
	fractional = "peresta"
}
numbers[3] = {
	cardinal = "neldë",
	ordinal = "neldëa",
	adverbial = 'nellumë',
	fractional = "nelesta"
}
numbers[4] = {
	cardinal = "canta",
	ordinal = "cantëa",
	adverbial = 'cantallumë',
	fractional = "canasta"
}
numbers[5] = {
	cardinal = "lempë",
	ordinal = "lempëa",
	adverbial = 'lempellumë',
	fractional = "lepesta"
}
numbers[6] = {
	cardinal = "enquë",
	ordinal = "enquëa",
	adverbial = 'enquellumë',
	fractional = "enquesta"
}
numbers[7] = {
	cardinal = "otso",
	ordinal = "otsëa",
	adverbial = 'otsollumë',
	fractional = "otosta"
}

numbers[8] = {
	cardinal = "toldo",
	ordinal = "toldëa",
	adverbial = 'toldollumë',
	fractional = "tolosta"
}
numbers[9] = {
	cardinal = "nertë",
	ordinal = "nertëa",
	adverbial = 'nertellumë',
	fractional = "neresta"
}

numbers[10] = {
	cardinal = "quëan",
	ordinal = "quainëa",
	adverbial = 'quëallumë',
	fractional = "quaista"
}
numbers[11] = {
	cardinal = "minquë",
	ordinal = "minquëa",
	adverbial = "minquellumë",
	fractional = "minquesta"
}
numbers[12] = {
	cardinal = "yunquë",
	ordinal = "yunquëa",
	adverbial = "yunquellumë",
	fractional = "yunquesta"
}
numbers[13] = {
	cardinal = "nelquë",
	ordinal = "nelquëa"
}
numbers[14] = {
	cardinal = "canquë",
	ordinal = "canquëa"
}
numbers[15] = {
	cardinal = "lepenquë",
	ordinal = "lepenquëa"
}
numbers[16] = {
	cardinal = "enenquë",
	ordinal = "enenquëa"
}
numbers[17] = {
	cardinal = "otoquë",
	ordinal = "otoquëa"
}
numbers[18] = {
	cardinal = "tolquë",
	ordinal = "tolquëa"
}
numbers[19] = {
	cardinal = "neterquë",
	ordinal = "neterquëa"
}

numbers[20] = {cardinal = "yuquain"}
numbers[30] = {cardinal = "nelquain"}
numbers[40] = {cardinal = "canquain"}
numbers[50] = {cardinal = "lepenquain"}
numbers[60] = {cardinal = "enquain"}
numbers[70] = {cardinal = "otoquain"}
numbers[80] = {cardinal = "tolquain"}
numbers[90] = {cardinal = "neterquain"}

local function unpack_ipairs(t)
	local i = 0
	return function()
		i = i + 1
		if t[i] then
			return i, unpack(t[i])
		end
	end
end

numbers[100] = {cardinal = "tuxa", fractional = "tuxasta"}

numbers[1000] = {cardinal = {"húmë", "tuxainen"}}
numbers[10000] = {cardinal = "quaihúmë"}

numbers[1000000] = {cardinal = "mindórë"}
numbers[1000000000] = {cardinal = "yundórë"}

local twstyle = "font-family: 'Tengwar Annatar', 'Tengwar Eldamar', 'Tengwar Noldor', 'Tengwar Parmaite', 'Tengwar Formal', 'Tengwar Elfica', 'Tengwar Sindarin', 'Tengwar Quenya', 'Tengwar Gothika'"
local digits = {'ñ', 'ò', 'ó', 'ô', 'õ', 'ö', '÷', 'ø', 'ù', 'ú', 'û'}
digits[0] = 'ð'
for key,value in pairs(numbers) do
	if key < 10 then
		numbers[key].numeral = '<span style="'..twstyle..'">'..digits[key]..'</span>'
	else
		local inp = tostring(key)
		local outp = {}
		for i = 0, #inp do
	    	local pos = #inp + 1 - i
	    	table.insert(outp, digits[tonumber(string.sub(inp, pos, pos))])
	    	table.insert(outp, 'G')
		end
		numbers[key].numeral = '<span style="'..twstyle..'">'..table.concat(outp)..'</span>'
	end
end

return export