Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to get 2 decimal places in java

total = (double) 100 / listMember.size();
DecimalFormat df = new DecimalFormat("#.##");
String dx = df.format(total);
total = Double.valueOf(dx);
Source by www.baeldung.com #
 
PREVIOUS NEXT
Tagged: #decimal #places #java
ADD COMMENT
Topic
Name
7+7 =