Open main menu
Home
Random
Log in
Settings
About Wikihussain
Disclaimers
Wikihussain
Search
Editing
Module:Numeral converter
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!
local p = {} -- Use this function from templates. function p.convert_template(frame) -- Third argument is optional; If true given, signs like dot (.) will be replaced. frame.args[3] = frame.args[3] or nil return p.convert(frame.args[1], frame.args[2], frame.args[3]) end -- Use this function directly in modules. function p.convert(lang, text, signs, virgule) text = tostring(text) signs = signs or nil virgule= virgule or nil if lang == "fa" or lang == "ur" or lang == "mzn" or lang == "glk" then -- برای فارسی، اردو، مازندرانی، گیلکی text = mw.ustring.gsub(text, "[0٠]", "۰") text = mw.ustring.gsub(text, "[1١]", "۱") text = mw.ustring.gsub(text, "[2٢]", "۲") text = mw.ustring.gsub(text, "[3٣]", "۳") text = mw.ustring.gsub(text, "[4٤]", "۴") text = mw.ustring.gsub(text, "[5٥]", "۵") text = mw.ustring.gsub(text, "[6٦]", "۶") text = mw.ustring.gsub(text, "[7٧]", "۷") text = mw.ustring.gsub(text, "[8٨]", "۸") text = mw.ustring.gsub(text, "[9٩]", "۹") if type(signs) ~= "nil" then text = mw.ustring.gsub(text, "%.", "٫") end elseif lang == "ar" or lang == "ckb" or lang == "ks" then -- برای عربی، کردی سورانی، کشمیری text = mw.ustring.gsub(text, "[۰0]", "٠") text = mw.ustring.gsub(text, "[۱1]", "١") text = mw.ustring.gsub(text, "[۲2]", "٢") text = mw.ustring.gsub(text, "[۳3]", "٣") text = mw.ustring.gsub(text, "[۴4]", "٤") text = mw.ustring.gsub(text, "[۵5]", "٥") text = mw.ustring.gsub(text, "[۶6]", "٦") text = mw.ustring.gsub(text, "[۷7]", "٧") text = mw.ustring.gsub(text, "[۸8]", "٨") text = mw.ustring.gsub(text, "[۹9]", "٩") elseif lang and lang ~= "" then -- برای همهٔ زبانهای دیگر text = mw.ustring.gsub(text, "[۰٠]", "0") text = mw.ustring.gsub(text, "[۱١]", "1") text = mw.ustring.gsub(text, "[۲٢]", "2") text = mw.ustring.gsub(text, "[۳٣]", "3") text = mw.ustring.gsub(text, "[۴٤]", "4") text = mw.ustring.gsub(text, "[۵٥]", "5") text = mw.ustring.gsub(text, "[۶٦]", "6") text = mw.ustring.gsub(text, "[۷٧]", "7") text = mw.ustring.gsub(text, "[۸٨]", "8") text = mw.ustring.gsub(text, "[۹٩]", "9") text = mw.ustring.gsub(text, "٫", ".") if type(virgule) ~= "nil" then text = mw.ustring.gsub(text, "،", ",") end end return text end return p
Summary:
Please note that all contributions to Wikihussain are considered to be released under the Creative Commons Attribution 4.0 (see
Wikihussain:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, 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.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:Numeral converter/توضیحات
(
edit
)