Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to set 2 decimal places in java

DecimalFormat df = new DecimalFormat();
df.setMaximumFractionDigits(2);
System.out.println(df.format(decimalNumber));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #set #decimal #places #java
ADD COMMENT
Topic
Name
3+4 =