Parses an string into an integer. If the value can't be parsed a default value is returned instead