minor changes

This commit is contained in:
Manuel Simon Hirsig
2016-08-15 20:18:40 +02:00
parent 2f594e7128
commit f7a1965b64
3 changed files with 32 additions and 11 deletions
+3 -2
View File
@@ -102,7 +102,7 @@ function public.to_string(money, pad, trim, decimal_points, color, no_color)
text = m.format_number(copper, false, decimal_points, color)..copper_text
end
end
if is_negative then
if color then
text = color..'-'..FONT_COLOR_CODE_CLOSE..text
@@ -115,7 +115,8 @@ function public.to_string(money, pad, trim, decimal_points, color, no_color)
end
function public.from_string(value)
for _, number in {tonumber(value)} do
local number = tonumber(value)
if number and number >= 0 then
return number * COPPER_PER_GOLD
end