java double format 2 decimal places code example
Example 1: java 2 decimals
double res = Math.round(a * 100) / 100;
Example 2: 2 decimal places print format JAVA
printf(%.2f);
double res = Math.round(a * 100) / 100;
printf(%.2f);