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
String truncatedValue = String.format("%f", percentageValue).split("\\.")[0];
solves the purpose
The problem is two fold-
(int) percentageValue
String.format("%.0f", percentageValue)
or new java.text.DecimalFormat("#").format(percentageValue)
as both of these round the decimal part.