// Java Program to Round a Number to n Decimal Places
// using format() Method
// Importing required classes
import java.io.*;
// Main class
class GFG {
// Main driver method
public static void main(String[] args)
{
// Declaring and initializing a double number
double number = 3.141341435;
// Rounding number to 2 decimal places
// using format method
System.out.format("%.2f", number);
}
}
double res = Math.round(a * 100) / 100;