Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

convert int to double with 2 decimal places java

double angle = 20.3034;
DecimalFormat df = new DecimalFormat("#.00");
String angleFormated = df.format(angle);
System.out.println(angleFormated); //output 20.30
 
PREVIOUS NEXT
Tagged: #convert #int #double #decimal #places #java
ADD COMMENT
Topic
Name
3+7 =