I am invoking a method called \"calculateStampDuty\", which will return the amount of stamp duty to be paid on a property. The percentage calculation works fine, and returns
Use Math.Round(double);
I have used it myself. It actually rounds off the decimal places.
d = 19.82; ans = Math.round(d); System.out.println(ans); // Output : 20 d = 19.33; ans = Math.round(d); System.out.println(ans); // Output : 19
Hope it Helps :-)