I am receiving points from database that is integer. After receiving points i am doing some calculation and showing result to user. Assume i received 20, 21, ,22. I am doing 21/1.5+20+22 which results in 43.50, But some time the points i receives is all even so the result will be like 50.00. The Problem Is i want to show 43.50 if decimal is not 00 And 50 If decimal is 00.. What data type should i use for calculation and show results like i mentioned above.THANKS. Currently I am using this but using integer wont show the decimal
int tot = a1+a2+a3+a4+a5+a6+a7+a8+a9+a10+a11+a12+a13+a14+a15+a16+a17+a18+a19+a20+a21+a22+a23+a24;