Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

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));
  }
}
 
PREVIOUS NEXT
Tagged: #print #float #number #places #decimal #point #java
ADD COMMENT
Topic
Name
9+6 =