some progress on the new auction table

This commit is contained in:
Manuel Simon Hirsig
2016-01-31 23:17:07 +01:00
parent 29e37a93ca
commit 2f62806761
10 changed files with 1223 additions and 64 deletions
+2 -1
View File
@@ -60,6 +60,7 @@ function m.to_string(money, pad, trim, color, no_color)
end
function m.from_string(value)
-- remove any colors
value = gsub(gsub(value, '\124c([0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])', ''), '\124r', '')
@@ -75,7 +76,7 @@ function m.from_string(value)
value = gsub(value, '%d*%.?%d+c', '', 1)
if strfind(value, '%S') then return 0 end
return ((gold or 0) * COPPER_PER_GOLD) + ((silver or 0) * COPPER_PER_SILVER) + (copper or 0)
return Aux.round(((gold or 0) * COPPER_PER_GOLD) + ((silver or 0) * COPPER_PER_SILVER) + (copper or 0))
end
function m.format_number(num, pad, color)