Cassandra Posted April 18, 2012 Share Posted April 18, 2012 internal protected DATATYPE Add<DATATYPE>(DATATYPE item1, DATATYPE item2) { return (item1 is string) && (item2 is string) ? (DATATYPE)Convert.ChangeType((item1.ToString() + item2.ToString()), typeof(DATATYPE)) : (DATATYPE)Convert.ChangeType((Convert.ToInt32(item1) + Convert.ToInt32(item2)), typeof(DATATYPE)); } I will be glad if you know a better way cause I think there are better ways. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now