Home
Random
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Sandbox/RexxS/Ordinal
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
-- Ordinals for Azerbaijani -- 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ı" } local 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 -- 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
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Module:Sandbox/RexxS/Ordinal
(
edit
)
Module:Sandbox/RexxS/Ordinal/doc
(
edit
)