close
Sayahna Sayahna
Search

Difference between revisions of "Module:OrdinalSuffix"


(test)
 
m (1 revision)
 
(No difference)

Latest revision as of 07:29, 22 August 2014

Documentation for this module may be created at Module:OrdinalSuffix/doc

local p = { }

function p.ordinalsuffix(frame)
    local args=frame.args
    numb =args[1]
    lastdigit = numb % 10
    if lastdigit == 1 then return "st"
    elseif lastdigit == 2 then return "nd"
    elseif lastdigit == 3 then return "rd"
    else return "th"
    end
end

return p