Home
Random
Log in
Settings
About HourGlass: The Game Wiki
Disclaimers
HourGlass: The Game Wiki
Search
Editing
Module:Tcartprice
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
local p = {} function p.tprice(frame) local price = frame.args["price"] local separator = frame.args["separator"] local gold = frame.args["gold"] local space = string.lower(frame.args["spacearoundseparator"]) local ulang = string.upper(mw.language.getContentLanguage():getCode()) local formattedprice = "[[File:Gold.png|18px|link=]]" if (string.lower(price) == "furniture") then formattedprice = formattedprice .. "250" if space == "true" then formattedprice = formattedprice .. " " .. separator .. " " else formattedprice = formattedprice .. separator end if (ulang ~= "ES") then formattedprice = formattedprice .. tostring(mw.language.getContentLanguage():formatNum(2500)) else formattedprice = formattedprice .. "2.500" end else local lowprice = tonumber(price) * 3 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 --Spanish if (lowprice < 1000) then formattedprice = formattedprice .. fmlowprice elseif (lowprice < 10000) then local length = #(fmlowprice) local temp = string.sub(fmlowprice, -3) formattedprice = formattedprice .. string.sub(fmlowprice, 1, (length-3)) .. "." .. temp else local temp = {mw.ustring.gsub(tostring(fmlowprice), "%s" , ".")} formattedprice = formattedprice .. temp[1] end end if space == "true" then formattedprice = formattedprice .. " " .. separator .. " " else formattedprice = formattedprice .. separator end if (highprice <= 1000) then 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 --Spanish and highprice > 1000 if (highprice < 10000) then local length = #(fmhighprice) local temp = string.sub(fmhighprice, -3) formattedprice = formattedprice .. string.sub(fmhighprice, 1, (length-3)) .. "." .. temp else local temp = {mw.ustring.gsub(tostring(fmhighprice), "%s" , ".")} formattedprice = formattedprice .. temp[1] end end end return formattedprice .. gold end return p
Summary:
Please note that all contributions to HourGlass: The Game Wiki are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) (see
HourGlass The Game Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:Tcartprice/doc
(
edit
)