Hi guys just wanted to know what the following represents or means in java
%.2f
I used it in a program I wrote and still have no idea what it actually means, the code looks like this
import java.util.Scanner;
/** Area.java
* This program computes the area of a circle
* Date created: 12 February 2018 */
public class Area {
public static void main(String []args) {
//constant declaration
final Double PI = 3.142159;
//variable declaration
double area, radius;
//input
Scanner sc = new Scanner(System.in);
System.out.print("Please enter the radius please: ");
radius = sc.nextDouble();
//processing
area = PI * radius * radius;
//output
System.out.printf("The area of the circle = %.2f", area);
}
}