better reporting
This commit is contained in:
@@ -20,4 +20,23 @@ function Aux.util.item_name_autocomplete()
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function Aux.util.format_money(val)
|
||||
|
||||
local g = math.floor(val / 10000)
|
||||
|
||||
val = val - g * 10000
|
||||
|
||||
local s = math.floor(val / 100)
|
||||
|
||||
val = val - s * 100
|
||||
|
||||
local c = math.floor(val)
|
||||
|
||||
local g_string = g ~= 0 and g .. 'g' or ''
|
||||
local s_string = s ~= 0 and s .. 's' or ''
|
||||
local c_string = (c ~= 0 or g == 0 and s == 0) and c .. 'c' or ''
|
||||
|
||||
return g_string .. s_string .. c_string
|
||||
end
|
||||
Reference in New Issue
Block a user