I have a table of decimal values that I’m looping though and adding to a variable called total. If the values don’t add up to be 1 then I show a warning message. The message says it equals 1 though so I’m at a loss.
Here is what it looks like when I loop though the table, add the value to the total variable and then print it
sceneBonus(261): 0.1 sceneBonus(261): 0.2 sceneBonus(261): 0.3 sceneBonus(261): 0.39 sceneBonus(261): 0.44 sceneBonus(261): 0.51 sceneBonus(261): 0.6 sceneBonus(261): 0.65 sceneBonus(261): 0.73 sceneBonus(261): 0.83 sceneBonus(261): 0.91 sceneBonus(261): 1
Here is the check I’m doing it
if(total ~= "1" and total ~= 1) then print("The odds don't add up to 1 it equals: " .. total) end
No matter what I try this is what gets printed
The odds don't add up to 1 it equals: 1
It has to be something so simple that I’m not seeing anyone have any ideas?
So I just did a math.floor(total) and it equals 0…wtf