Module:Price: Difference between revisions

From Roat Pkz
Jump to navigation Jump to search
(Replaced content with "-- <nowiki> local p = {} function p.hello( frame ) return 'Hello, world!' end return p -- </nowiki>")
Tag: Replaced
No edit summary
Tag: Manual revert
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
-- <nowiki>
local p = {}
local p = {}


function p.hello( frame )
local coins = require('Module:Coins')
    return 'Hello, world!'
local exchange = require('Module:Exchange')
 
--
-- Module access point
--
function p._main(target)
-- return target
if not target then
return 'N/A'
end
 
target = tostring(target)
local amount = exchange._price(target)
return coins._amount(amount)
end
end
--
-- {{Coins}} access point
--
function p.main(frame)
local args = frame:getParent().args
return p._main(args[1])
end
--[[ DEBUG =
= p._main('Watering can')
= p._main()
--]]


return p
return p
-- </nowiki>

Latest revision as of 19:02, 3 April 2024

Documentation for this module may be created at Module:Price/doc

local p = {}

local coins = require('Module:Coins')
local exchange = require('Module:Exchange')

--
-- Module access point
--
function p._main(target)
	-- return target
	if not target then
		return 'N/A'
	end

	target = tostring(target)
	local amount = exchange._price(target)
	return coins._amount(amount)
end

--
-- {{Coins}} access point
--
function p.main(frame)
	local args = frame:getParent().args
	return p._main(args[1])
end

--[[ DEBUG =
= p._main('Watering can')
= p._main()
--]]

return p