private static Format getPercentFormatProcessor ( ColumnFormat columnFormat , Locale locale ) { DecimalFormatSymbols dfs = new DecimalFormatSymbols ( locale ) ; if ( columnFormat . getPrecision ( ) == 0 ) { return new DecimalFormat ( "0%" , dfs ) ; } String pattern = "0%." + new String ( new char [ columnFormat . getPrecision ( ) ] ) . replace ( "\0" , "0" ) ; return new DecimalFormat ( pattern , dfs ) ; }
The function to get a formatter to convert percentage elements into a string .