I store some data in a database and I read those data with a cursor. All the data are 56.45 , 3.04, 0.03 type, so two numbers after the decimal point. Now I would like to sum th
Other approach, you can define your sum variable as double and then you can set NumberFormat for your sum variable.
double
NumberFormat
Example:
double sum = 21.2015; NumberFormat formatter = new DecimalFormat("#.##"); formatter.format(sum);