mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-16 09:50:50 +00:00
api: handle empty money strings
This commit is contained in:
@@ -358,6 +358,8 @@ end
|
|||||||
-- return: [string] a colorized string which is split into
|
-- return: [string] a colorized string which is split into
|
||||||
-- gold,silver and copper values.
|
-- gold,silver and copper values.
|
||||||
function pfUI.api.CreateGoldString(money)
|
function pfUI.api.CreateGoldString(money)
|
||||||
|
if type(money) ~= "number" then return "-" end
|
||||||
|
|
||||||
local gold = floor(money/ 100 / 100)
|
local gold = floor(money/ 100 / 100)
|
||||||
local silver = floor(mod((money/100),100))
|
local silver = floor(mod((money/100),100))
|
||||||
local copper = floor(mod(money,100))
|
local copper = floor(mod(money,100))
|
||||||
|
|||||||
Reference in New Issue
Block a user