fix2009
asked on
Round Up Integer
(389 * 10) / 100
I want the value 0.39 out of the above expression. But it is giving 0.38. Whats the best way to apply round up.
I want the value 0.39 out of the above expression. But it is giving 0.38. Whats the best way to apply round up.
Are you sure the expresssion is corecct -
(389*10) = 3890
3890/100 = 38.9
(389*10) = 3890
3890/100 = 38.9
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
a_b's point is correct. My solution is for getting the answer from 38 to 39. If you are truly getting 0.38 then post the correct formula.
fix2009,
Glad that helped you. If you don't mind me asking, why the "B" grade there. If you need more explanation on something, just ask. A "B" signifies you have to do research to get to the complete solution; therefore, please advise what is missing so can better help others in the future.
Happy coding!
Regards,
Kevin
Glad that helped you. If you don't mind me asking, why the "B" grade there. If you need more explanation on something, just ask. A "B" signifies you have to do research to get to the complete solution; therefore, please advise what is missing so can better help others in the future.
Happy coding!
Regards,
Kevin
ASKER
Hi mwvisa1, I think I didnt think before choosing the grade. Your answer is accurate. I wish I can change it now to 'A'.
double d = (double) (389 * 10) / 100