--[[ This template will add the appropriate ordinal suffix to a given integer.Please do not modify this code without applying the changes first atModule:Ordinal/sandbox and testing at Module:Ordinal/sandbox/testcases andModule talk:Ordinal/sandbox/testcases.]]localp={}localyesno=require('Module:Yesno')-- boolean value interpretation--[[This function converts an integer value into a numeral followed by ordinal indicator.The output string might contain HTML tags.Usage:{{#invoke:Ordinal|ordinal|1=|2=}}{{#invoke:Ordinal|ordinal}} - uses the caller's parametersParameters 1: Any number or string. 2: Set to "م" if the module should display "اُم" instead of "اُمین". sup: Set to yes/no to toggle superscript ordinal suffix.]]functionp.ordinal(frame)localargs=frame.argslocalsuffix="اُمین"ifargs[1]==nilthenargs=frame:getParent().argsendifargs[1]==nilthenargs[1]="{{{1}}}"endreturnp._ordinal(args[1],(args[2]=='م'),yesno(args.sup))endfunctionp._ordinal(n,d,sup)localsuffix="اُمین"ifdthensuffix="اُم"endifsupthensuffix="<sup>"..suffix.."</sup>"endreturnn..suffixendreturnp