package org.shypl.common.util;


import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.NumberFormat;
import java.util.Locale;

public final class NumberFormatUtils {

	private NumberFormatUtils() {

	}

	public static DecimalFormat decimalFormat() {

		DecimalFormat formatter = (DecimalFormat)NumberFormat.getInstance(Locale.US);
		DecimalFormatSymbols symbols = formatter.getDecimalFormatSymbols();

		symbols.setGroupingSeparator(' ');
		formatter.setDecimalFormatSymbols(symbols);
		return formatter;
	}

	public static DecimalFormat percentFormat() {
		DecimalFormat format = decimalFormat();
		format.setPositiveSuffix("%");
		format.setNegativeSuffix("%");
		format.setMinimumFractionDigits(2);
		format.setMaximumFractionDigits(2);
		format.setRoundingMode(RoundingMode.HALF_UP);
		return format;
	}
}

@@ -224,17 +224,18 @@
 Utils %7B%0A
+%09
 %0A
-
 %09private
@@ -257,21 +257,24 @@
 ils() %7B%0A
+%09%09
 %0A
-
 %09%7D%0A
+%09
 %0A
-
 %09public 
@@ -312,17 +312,115 @@
 mat() %7B%0A
+%09%09return decimalFormat(false);%0A%09%7D%0A%09%0A%09public static DecimalFormat decimalFormat(boolean showSign) %7B
 %0A
-
 %09%09Decima
@@ -561,17 +561,19 @@
 bols();%0A
+%09%09
 %0A
-
 %09%09symbol
@@ -647,16 +647,81 @@
 mbols);%0A
+%09%09%0A%09%09if (showSign) %7B%0A%09%09%09formatter.setPositivePrefix(%22+%22);%0A%09%09%7D%0A%09%09%0A
 %09%09return
@@ -735,16 +735,17 @@
 ter;%0A%09%7D%0A
+%09
 %0A%09public

add posibility to show + on positive numbers