Línea 7: |
Línea 7: |
| local space = string.lower(frame.args["spacearoundseparator"]) | | local space = string.lower(frame.args["spacearoundseparator"]) |
| local ulang = string.upper(mw.language.getContentLanguage():getCode()) | | local ulang = string.upper(mw.language.getContentLanguage():getCode()) |
− | | + | |
| + | local lowprice, highprice, temp, temp2 |
| local formattedprice = "[[File:Gold.png|18px|link=]]" | | local formattedprice = "[[File:Gold.png|18px|link=]]" |
| | | |
Línea 23: |
Línea 24: |
| end | | end |
| else | | else |
− | if ((tonumber(price) * 3) <= 100) then | + | lowprice = tonumber(price) * 3 |
− | formattedprice = formattedprice .. "100" | + | highprice = tonumber(price) * 5 |
| + | |
| + | if (lowprice <= 100) then |
| + | formattedprice = formattedprice .. "100" |
| + | elseif (ulang ~= "ES") then |
| + | formattedprice = formattedprice .. tostring(mw.language.getContentLanguage():formatNum(lowprice)) |
| else | | else |
− | if (((tonumber(price) * 3) < 1000) or (ulang ~= "ES")) then | + | --Spanish |
− | formattedprice = formattedprice .. tostring(mw.language.getContentLanguage():formatNum(tonumber(price) * 3))
| + | temp = tostring(mw.language.getContentLanguage():formatNum(lowprice)) |
− | else | + | |
− | local temp = tonumber(price) * 3
| + | if (temp < 10000) then |
− | if (temp < 10000) then
| + | local length = #(tostring(temp)) |
− | length = #(tostring(temp))
| + | temp2 = string.sub(tostring(temp), -3) |
− | local temp2 = string.sub(tostring(temp), -3)
| + | formattedprice = formattedprice .. string.sub(tostring(temp), 1, (length-3)) .. "." .. temp2 |
− | formattedprice = formattedprice .. string.sub(tostring(temp), 1, (length-3)) .. "." .. temp2
| + | else |
− | else
| + | temp2 = {mw.ustring.gsub(tostring(formattedSum), "%s" , ".")} |
− | temp = {mw.ustring.gsub(tostring(temp), "%s" , ".")}
| + | formattedprice = formattedprice .. temp2[1] |
− | formattedprice = formattedprice .. temp[1]
| + | end |
− | end
| + | |
| + | if space == "true" then formattedprice = formattedprice .. " " .. separator .. " " |
| + | else formattedprice = formattedprice .. separator |
| end | | end |
| end | | end |
− | | + | if (highprice <= 1000) then |
− |
| + | if (ulang ~= "ES") then |
− | if space == "true" then formattedprice = formattedprice .. " " .. separator .. " " | |
− | else formattedprice = formattedprice .. separator
| |
− | end
| |
− |
| |
− | if ((tonumber(price) * 5) <= 1000) then
| |
− | if (ulang ~= ES) then | |
| formattedprice = formattedprice .. tostring(mw.language.getContentLanguage():formatNum(1000)) | | formattedprice = formattedprice .. tostring(mw.language.getContentLanguage():formatNum(1000)) |
− | else | + | else formattedprice = formattedprice .. "1.000" |
− | formattedprice = formattedprice .. "1.000"
| + | end |
− | end | + | elseif (ulang ~= "ES") then |
− | elseif (ulang ~= ES) then | + | formattedprice = formattedprice .. tostring(mw.language.getContentLanguage():formatNum(highprice)) |
− | formattedprice = formattedprice .. tostring(mw.language.getContentLanguage():formatNum(tonumber(price) * 5)) | |
| else | | else |
− | local temp = tonumber(price) * 5 | + | --Spanish and highprice > 1000 |
| + | temp = tostring(mw.language.getContentLanguage():formatNum(highprice)) |
| + | |
| if (temp < 10000) then | | if (temp < 10000) then |
− | length = #(tostring(temp)) | + | local length = #(tostring(temp)) |
− | local temp2 = string.sub(tostring(temp), -3) | + | temp2 = string.sub(tostring(temp), -3) |
| formattedprice = formattedprice .. string.sub(tostring(temp), 1, (length-3)) .. "." .. temp2 | | formattedprice = formattedprice .. string.sub(tostring(temp), 1, (length-3)) .. "." .. temp2 |
− | else | + | else |
− | temp = {mw.ustring.gsub(tostring(temp), "%s" , ".")} | + | temp2 = {mw.ustring.gsub(tostring(formattedSum), "%s" , ".")} |
− | formattedprice = formattedprice .. temp[1] | + | formattedprice = formattedprice .. temp2[1] |
| end | | end |
| end | | end |
| end | | end |
| | | |
− | formattedprice = formattedprice .. gold | + | return formattedprice .. gold |
− | | |
− | return formattedprice
| |
| end | | end |
| | | |
| return p | | return p |