Cambios

4 bytes añadidos ,  05:55 31 may 2023
sin resumen de edición
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 24: Línea 23:  
end
 
end
 
else
 
else
lowprice = tonumber(price) * 3
+
local lowprice = tonumber(price) * 3
highprice = tonumber(price) * 5
+
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
 
if (lowprice <= 100) then
 
formattedprice = formattedprice .. "100"
 
formattedprice = formattedprice .. "100"
 
elseif (ulang ~= "ES") then
 
elseif (ulang ~= "ES") then
formattedprice = formattedprice .. tostring(mw.language.getContentLanguage():formatNum(lowprice))
+
formattedprice = formattedprice .. fmlowprice
 
else
 
else
 
--Spanish
 
--Spanish
temp = tostring(mw.language.getContentLanguage():formatNum(lowprice))
+
if (tonumber(fmlowprice) < 1000) then
 
+
formattedprice = formattedprice .. fmlowprice
if (tonumber(temp) < 1000) then
+
elseif (tonumber(fmlowprice) < 10000) then
formattedprice = formattedprice .. lowprice
+
local length = #(tonumber(fmlowprice))
elseif (tonumber(temp) < 10000) then
+
local temp = string.sub(fmlowprice, -3)
local length = #(temp)
+
formattedprice = formattedprice .. string.sub(fmlowprice, 1, (length-3)) .. "." .. temp
temp2 = string.sub(temp, -3)
  −
formattedprice = formattedprice .. string.sub(temp, 1, (length-3)) .. "." .. temp2
   
else
 
else
temp2 = {mw.ustring.gsub(tostring(formattedSum), "%s" , ".")}
+
local temp = {mw.ustring.gsub(tostring(fmlowprice), "%s" , ".")}
formattedprice = formattedprice .. temp2[1]
+
formattedprice = formattedprice .. temp[1]
 
end
 
end
 
end
 
end
Línea 57: Línea 56:  
end
 
end
 
elseif (ulang ~= "ES") then
 
elseif (ulang ~= "ES") then
formattedprice = formattedprice .. tostring(mw.language.getContentLanguage():formatNum(highprice))
+
formattedprice = formattedprice .. fmhighprice
 
else
 
else
 
--Spanish and highprice > 1000
 
--Spanish and highprice > 1000
temp = tostring(mw.language.getContentLanguage():formatNum(highprice))
+
temp = fmhighprice
 
 
if (tonumber(temp) < 10000) then
+
if (tonumber(fmhighprice) < 10000) then
local length = #(temp)
+
local length = #(tonumber(fmhighprice))
temp2 = string.sub(temp, -3)
+
local temp = string.sub(fmhighprice, -3)
formattedprice = formattedprice .. string.sub(temp, 1, (length-3)) .. "." .. temp2
+
formattedprice = formattedprice .. string.sub(fmhighprice, 1, (length-3)) .. "." .. temp
 
else
 
else
temp2 = {mw.ustring.gsub(tostring(formattedSum), "%s" , ".")}
+
local temp = {mw.ustring.gsub(tostring(fmhighprice), "%s" , ".")}
formattedprice = formattedprice .. temp2[1]
+
formattedprice = formattedprice .. temp[1]
 
end
 
end
 
end
 
end
106 438

ediciones