Modul:Ordinal
Bu modulun sənədləşdirmə səhifəsi Modul:Ordinal/doc səhifəsində yaradıla bilər
-- Ordinals for Azerbaijani by RexxS -- Takes a number and returns its ordinal. local suffixes = { "ci", "ci", "cü", "cü", "ci", "cı", "ci", "ci", "cu", [0] = "cu", [10] = "cu", [20] = "ci", [30] = "cu", [40] = "cı", [50] = "ci", [60] = "cı", [70] = "ci", [80] = "ci", [90] = "cı" } function ordinal(number) local suffix if number == 0 then suffix = "cı" elseif number % 1000 == 0 then suffix = "ci" elseif number %100 == 0 then suffix = "cü" elseif number %10 == 0 then suffix = suffixes[number % 100] else suffix = suffixes[number %10] or "" end return number .. "-" .. suffix end -- Global inYear function function inYear( year ) if year >= 0 then return ordinal(year) else year = -year return 'e.ə. ' .. ordinal(year) end end -- Global checkApril function function checkApril(elseThanApril, displaySuffixMonth) if (elseThanApril == 4 or elseThanApril == '[Aa]prel') then return displaySuffixMonth .. 'də' else return displaySuffixMonth .. 'da' end end -- Just for testing by allowing a #invoke: call p = {} function p.Ordinal(frame) number = tonumber(frame.args[1] or frame.args.number) or 0 return ordinal(number) end return p