Cambios

78 bytes eliminados ,  06:02 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 (lowprice < 1000) then
 
+
formattedprice = formattedprice .. fmlowprice
if (tonumber(temp) < 1000) then
+
elseif (lowprice < 10000) then
formattedprice = formattedprice .. lowprice
+
local length = #(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
 
 
if space == "true" then formattedprice = formattedprice .. " " .. separator .. " "
+
if space == "true" then formattedprice = formattedprice .. " " .. separator .. " "
else formattedprice = formattedprice .. separator
+
else formattedprice = formattedprice .. separator
end
   
end
 
end
 +
 
if (highprice <= 1000) then
 
if (highprice <= 1000) then
 
if (ulang ~= "ES") then  
 
if (ulang ~= "ES") then  
Línea 56: 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))
+
if (highprice < 10000) then
+
local length = #(fmhighprice)
if (tonumber(temp) < 10000) then
+
local temp = string.sub(fmhighprice, -3)
local length = #(temp)
+
formattedprice = formattedprice .. string.sub(fmhighprice, 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(fmhighprice), "%s" , ".")}
formattedprice = formattedprice .. temp2[1]
+
formattedprice = formattedprice .. temp[1]
 
end
 
end
 
end
 
end
106 448

ediciones