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
You can convert your empty row to integer value and check zero?.
"".to_i.zero? => true nil.to_i.zero? => true