Answers for "print float number with only four places after the decimal point in java"

0

print float number with only four places after the decimal point in java

import java.text.DecimalFormat;
public class code{
  public static void main(String[] args){
		double area= 12.21564315;
       	DecimalFormat df = new DecimalFormat("0.0000");
       	System.out.println("A="+df.format(area));
  }
}
Posted by: Guest on March-07-2022
3

2 decimal places print format JAVA

printf(%.2f);
Posted by: Guest on April-21-2020

Code answers related to "print float number with only four places after the decimal point in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language