question: public static String formatNumber ( final BigDecimal number , final int fractionDigits , final boolean useGrouping ) { final NumberFormat numberFormat = NumberFormat . getInstance ( ) ; numberFormat . setMinimumFractionDigits ( fractionDigits ) ; numberFormat . setMaximumFractionDigits ( fractionDigits ) ; numberFormat . setGroupingUsed ( useGrouping ) ; return numberFormat . format ( number . doubleValue ( ) ) ; }
target:  Formats a given number with given number of fraction digits <br> e.g. formatNumber(1000, 2, false) will return 1000.00 <br> formatNumber(1000, 2, true) will return 1,000.00 <br>