@ Pure public static String formatDouble ( double amount , int decimalCount ) { final int dc = ( decimalCount < 0 ) ? 0 : decimalCount ; final StringBuilder str = new StringBuilder ( "#0" ) ; //$NON-NLS-1$ if ( dc > 0 ) { str . append ( ' ' ) ; for ( int i = 0 ; i < dc ; ++ i ) { str . append ( ' ' ) ; } } final DecimalFormat fmt = new DecimalFormat ( str . toString ( ) ) ; return fmt . format ( amount ) ; }
Format the given double value .