"ମଡ୍ୟୁଲ:ConvertDigit" ପୃଷ୍ଠାର ସଂସ୍କରଣଗୁଡ଼ିକ ମଧ୍ୟରେ ତଫାତ
Content deleted Content added
ଟିକେNo edit summary ଟ୍ୟାଗ: Reverted |
ଟିକେ Jnanaranjan sahu (ଆଲୋଚନା)ଙ୍କ ଦେଇ କରାଯାଇଥିବା ବଦଳକୁ Snip1ଙ୍କ ଦେଇ କରାଯାଇଥିବା ଶେଷ ବଦଳକୁ ଫେରାଇ ଦିଆଗଲା ଟ୍ୟାଗ: Rollback |
||
୧ କ ଧାଡ଼ି:
-- First, define a table of text to search for, and what to convert it to.
local
['0'] = '୦',
['1'] = '୧',
୨୭ କ ଧାଡ଼ି:
}
local
['January'] = 'ଜାନୁଆରୀ',
['February'] = 'ଫେବୃଆରୀ',
୬୮ କ ଧାଡ଼ି:
['9'] = '୯',
}
-- Then we define a table to hold our function
local p = {}
-- define a function that converts english digits to Odia digits only nothing else.
local s = frame.args[1] -- This gets the first positional argument.
for en, odia in pairs(convertDigitOnly) do -- This converts every digit found in the table.
s = mw.ustring.gsub(s, en, odia)
end
return s -- Get the result of the function.
end
-- define a function that converts Odia digits to English digits only nothing else.
▲local function main(frame)
function p.Or2endigit(frame)
local s = frame.args[1] -- This gets the first positional argument.
for en, odia in pairs(Odia2EngDigitOnly) do -- This converts every digit found in the table.
s = mw.ustring.gsub(s, en, odia)
end
return s -- Get the result of the function.
end
-- Then we define a function that converts strings using conversionTable.
function p.main(frame)
local s = frame.args[1] -- This gets the first positional argument.
for en, odia in pairs(conversionTable) do -- This converts every string found in the table.
s = mw.ustring.gsub(s, en, odia)
end
return s -- Get the result of the function.
end
return p -- Pass our table containing our function back to Lua.
-- Now we can call our function using {{#invoke:ConvertDigit|main|<!-- your text here
-->}}.
|