I am using the following code to check if a variable is not nil and not zero
if(discount != nil && discount != 0) ... end
Is the
if discount and discount != 0 .. end
update, it will false for discount = false
false
discount = false