Why not set this to an empty string instead of "0"?  You are checking for empty string in the other if blocks and it will always have 0 as the default value.