Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

decimal format

public static final DecimalFormat df1 = new DecimalFormat( "#.##" );
public static final DecimalFormat df2 = new DecimalFormat( "#.00" );

System.out.println(df1.format(7.80));
System.out.println(df1.format(85));
System.out.println(df1.format(85.786));

System.out.println(df2.format(7.80));
System.out.println(df2.format(85));
System.out.println(df2.format(85.786));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #decimal #format
ADD COMMENT
Topic
Name
9+1 =