Cambios

340 bytes añadidos ,  06:02 31 may 2023
sin resumen de edición
Línea 23: Línea 23:  
end
 
end
 
else
 
else
if ((tonumber(price) * 3) <= 100) then
+
local lowprice = tonumber(price) * 3
formattedprice = formattedprice .. "100"
+
local highprice = tonumber(price) * 5
 +
local fmlowprice = tostring(mw.language.getContentLanguage():formatNum(lowprice))
 +
local fmhighprice = tostring(mw.language.getContentLanguage():formatNum(highprice))
 +
 +
if (lowprice <= 100) then
 +
formattedprice = formattedprice .. "100"
 +
elseif (ulang ~= "ES") then
 +
formattedprice = formattedprice .. fmlowprice
 
else
 
else
if (((tonumber(price) * 3) < 1000) or (ulang ~= "ES")) then
+
--Spanish
formattedprice = formattedprice .. tostring(mw.language.getContentLanguage():formatNum(tonumber(price) * 3))
+
if (lowprice < 1000) then
else
+
formattedprice = formattedprice .. fmlowprice
local temp = tonumber(price) * 3
+
elseif (lowprice < 10000) then
if (temp < 10000) then
+
local length = #(fmlowprice)
length = #(tostring(temp))
+
local temp = string.sub(fmlowprice, -3)
temp2 = string.sub(tostring(temp), -3)
+
formattedprice = formattedprice .. string.sub(fmlowprice, 1, (length-3)) .. "." .. temp
formattedprice = formattedprice .. string.sub(tostring(temp), 1, (length-3)) .. "." .. temp2
+
else
else
+
local temp = {mw.ustring.gsub(tostring(fmlowprice), "%s" , ".")}
temp = {mw.ustring.gsub(tostring(temp), "%s" , ".")}
+
formattedprice = formattedprice .. temp[1]
formattedprice = formattedprice .. temp[1]
  −
end
   
end
 
end
 
end
 
end
 
+
   
if space == "true" then formattedprice = formattedprice .. " " .. separator .. " "
 
if space == "true" then formattedprice = formattedprice .. " " .. separator .. " "
 
else formattedprice = formattedprice .. separator
 
else formattedprice = formattedprice .. separator
 
end
 
end
+
if ((tonumber(price) * 5) <= 1000) then
+
if (highprice <= 1000) then
formattedprice = formattedprice .. tostring(mw.language.getContentLanguage():formatNum(1000))
+
if (ulang ~= "ES") then
 +
formattedprice = formattedprice .. tostring(mw.language.getContentLanguage():formatNum(1000))
 +
else formattedprice = formattedprice .. "1.000"
 +
end
 +
elseif (ulang ~= "ES") then
 +
formattedprice = formattedprice .. fmhighprice
 
else
 
else
local temp = tonumber(price) * 5
+
--Spanish and highprice > 1000
if (temp < 10000) then
+
if (highprice < 10000) then
length = #(tostring(temp))
+
local length = #(fmhighprice)
temp2 = string.sub(tostring(temp), -3)
+
local temp = string.sub(fmhighprice, -3)
formattedprice = formattedprice .. string.sub(tostring(temp), 1, (length-3)) .. "." .. temp2
+
formattedprice = formattedprice .. string.sub(fmhighprice, 1, (length-3)) .. "." .. temp
else
+
else
temp = {mw.ustring.gsub(tostring(temp), "%s" , ".")}
+
local temp = {mw.ustring.gsub(tostring(fmhighprice), "%s" , ".")}
formattedprice = formattedprice .. temp[1]
+
formattedprice = formattedprice .. temp[1]
end
+
end
 
end
 
end
 
end
 
end
 
 
formattedprice = formattedprice .. gold
+
return formattedprice .. gold
 
  −
return formattedprice
   
end
 
end
    
return p
 
return p
106 438

ediciones