Skip to content

Commit

Permalink
fix sub 10 silver with reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
scrable committed Mar 31, 2020
1 parent 56120a1 commit a15d96c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions TSM_PriceChecker/Modules/Util.lua
Original file line number Diff line number Diff line change
@@ -8,8 +8,9 @@ function Util:ConvertPriceToMoney(price, currency)
amount = floor(price/10000) -- divide price by 10000 to decide gold and floor it to get rid of hang overs
return amount or 0 -- Make sure it always returns a number
elseif currency == "Silver" then
amount = floor(strsub(price, -4) / 100) -- strsub will only see the last 4 numbers of a sentece and divide it by 100
return amount or 0
amount = floor(strsub(price, -4)/100) -- strsub will only see the last 4 numbers of a sentece and divide it by 100
if string.len(amount) < 2 then amount = "0"..floor(strsub(price, -4)/100) end
return amount
elseif currency == "Copper" then
amount = floor(strsub(price, -2)) -- no division needed for 10th's
return amount or 0

0 comments on commit a15d96c

Please sign in to comment.