Cambios

452 bytes añadidos ,  17:22 3 may 2023
decimal separator for ES numbers
Línea 10: Línea 10:  
local quality = tonumber(frame.args.q)
 
local quality = tonumber(frame.args.q)
 
local profmult = tonumber(frame.args.pm)
 
local profmult = tonumber(frame.args.pm)
local ulang = string.upper(frame.args.ll)
   
local toFormatOrNotToFormat = string.lower(frame.args.fm)
 
local toFormatOrNotToFormat = string.lower(frame.args.fm)
   Línea 33: Línea 32:  
elseif ((item == "jelly") or (item == "pickles")) then
 
elseif ((item == "jelly") or (item == "pickles")) then
 
artisanprice = (50 + (baseprice * 2))
 
artisanprice = (50 + (baseprice * 2))
elseif (item == "roe") then
  −
artisanprice = (30 + math.floor(baseprice / 2))
  −
elseif (item == "aged roe") then
  −
artisanprice = (2 * (30 + math.floor(baseprice / 2)))
   
elseif (item == "honey") then
 
elseif (item == "honey") then
 
--This is a hack that works only because
 
--This is a hack that works only because
Línea 45: Línea 40:  
artisanprice = 100
 
artisanprice = 100
 
end
 
end
elseif (item == "pale ale") then artisanprice = 300
+
elseif (string.find(item, "aged roe") ~= nil) then
 +
artisanprice = (2 * (30 + math.floor(baseprice / 2)))
 +
elseif (string.find(item, "roe") ~= nil) then
 +
artisanprice = (30 + math.floor(baseprice / 2))
 +
--[[elseif (item == "pale ale") then artisanprice = 300
 
elseif ((item == "beer") or (item == "mead")) then artisanprice = 200
 
elseif ((item == "beer") or (item == "mead")) then artisanprice = 200
 
elseif (item == "green tea") then artisanprice = 100
 
elseif (item == "green tea") then artisanprice = 100
--[[elseif (item == "caviar") then artisanprice = 500
+
elseif (item == "caviar") then artisanprice = 500
 
elseif (item == "cheese") then artisanprice = 230
 
elseif (item == "cheese") then artisanprice = 230
 
elseif (item == "goat cheese") then artisanprice = 400
 
elseif (item == "goat cheese") then artisanprice = 400
Línea 66: Línea 65:     
local formattedSum = mw.language.getContentLanguage():formatNum(sum)
 
local formattedSum = mw.language.getContentLanguage():formatNum(sum)
 +
local ulang = string.upper(mw.language.getContentLanguage():getCode())
    
if ulang == "DE" then return formattedSum .. " G"
 
if ulang == "DE" then return formattedSum .. " G"
elseif (ulang == "EN" or ulang == "HU" or ulang == "TR") then
+
elseif (ulang == "EN" or ulang == "JA" or ulang == "HU" or ulang == "TR") then
 
return formattedSum .. "g"
 
return formattedSum .. "g"
elseif ulang == "ES" then return formattedSum .. "[[File:Gold.png|18px|link=]]"
+
elseif ulang == "ES" then
 +
if (sum < 1000) then return formattedSum .. "[[File:Gold.png|18px|link=]]"
 +
elseif (sum < 10000) then
 +
local length = #(tostring(sum))
 +
local temp = string.sub(tostring(sum), -3)
 +
return string.sub(tostring(sum), 1, (length-3)) .. "." .. temp .. "[[File:Gold.png|18px|link=]]"
 +
else
 +
local temp = {mw.ustring.gsub(tostring(formattedSum), "%s" , ".")}
 +
return temp[1] .. "[[File:Gold.png|18px|link=]]"
 +
end
 
elseif ulang == "FR" then return formattedSum .. "po"
 
elseif ulang == "FR" then return formattedSum .. "po"
 
elseif ulang == "IT" then return formattedSum .. "o"
 
elseif ulang == "IT" then return formattedSum .. "o"
105 789

ediciones