Java Double Number Format isDoubleWhitFormat(String pValue)

Here you can find the source of isDoubleWhitFormat(String pValue)

Description

is Double Whit Format

License

Open Source License

Declaration

public static boolean isDoubleWhitFormat(String pValue) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static boolean isDoubleWhitFormat(String pValue) {
        try {//www . j  a  va 2 s . c  om
            if (!pValue.equals("")) {
                java.text.DecimalFormat formatDecimal = new java.text.DecimalFormat(
                        "###,##0.00");
                java.text.DecimalFormatSymbols symbols = new java.text.DecimalFormatSymbols();
                symbols.setGroupingSeparator(',');
                symbols.setDecimalSeparator('.');
                formatDecimal.setDecimalFormatSymbols(symbols);
                double valor = formatDecimal.parse(pValue).doubleValue();
                //        double valor = Double.parseDouble(pValue);
                return true;
            } else
                return false;
        } catch (Exception e) {
            return false;
        }
    }
}

Related

  1. getFormattedString(double d, int numDecimalPlaces)
  2. getFormattedTwoDecimal(double d)
  3. getFormattedValue(double argDoubleValue)
  4. getTwoDecimalByDecimalFormat(double number)
  5. getValidString(Double value, DecimalFormat formatter)
  6. prettyDecimalFormat(double d, int numPlaces)
  7. roundFormat(double d, int i)
  8. shorten(double num)
  9. toDoubleFromHumanFormat(String doubleAsString)