Example usage for java.lang Double valueOf

List of usage examples for java.lang Double valueOf

Introduction

In this page you can find the example usage for java.lang Double valueOf.

Prototype

@HotSpotIntrinsicCandidate
public static Double valueOf(double d) 

Source Link

Document

Returns a Double instance representing the specified double value.

Usage

From source file:Main.java

protected static final String encodingUTF8andIndex(byte[] src, int srart, int length) throws Exception {
    byte[] b = new String(src, srart, length, "euc-kr").getBytes("utf-8");
    String str = new String(b).trim();
    return new DecimalFormat("###,###.00").format(Double.valueOf(str));
}

From source file:Main.java

public static double crin2LFormula3() {
    double rs = 0;

    double h4 = Double.valueOf(DATA_MAP.get("h4"));
    double h6 = Double.valueOf(DATA_MAP.get("h6"));

    rs = h4 - h6 - CRIN2_L_OL - CRIN2_L_AH;

    return rs;/*from   w  w w.j  av  a  2s  .c o m*/
}

From source file:Main.java

public static double crin16Formula4() {
    double rs = 0;

    double h8 = Double.valueOf(DATA_MAP.get("h8"));
    double h9 = Double.valueOf(DATA_MAP.get("h9"));
    double h10 = Double.valueOf(DATA_MAP.get("h10"));

    rs = h8 - h9 - (h10 - CRIN1_6_VF / 50) + CRIN1_6_AH;

    return rs;/* w  w  w .j  a  v a2 s . c o m*/
}

From source file:Main.java

public static double cri1998Formula3() {
    double rs = 0;

    double h6 = Double.valueOf(DATA_MAP.get("h6"));
    double h7 = Double.valueOf(DATA_MAP.get("h7"));
    double h8 = Double.valueOf(DATA_MAP.get("h8"));

    rs = h7 - h6 - (h8 - CRI1_998_VF / 50.3) + CRI1_998_AH;

    return rs;/*from   w w w  .j a va 2s  . c  om*/
}

From source file:Main.java

public static double getSalesDone(String budget, String Sales) {
    DecimalFormat twoDForm = new DecimalFormat("#.##");

    double bud = Double.parseDouble(budget);
    double sale = Double.parseDouble(Sales);

    double result = (sale / bud) * 100;

    result = Double.valueOf(twoDForm.format(result));
    return result;

}

From source file:Main.java

public final static int convertToInt(Object value, int defaultValue) {
    if (value == null || "".equals(value.toString().trim())) {
        return defaultValue;
    }/*  ww  w  .  j a v a 2 s  . c o m*/
    try {
        return Integer.valueOf(value.toString());
    } catch (Exception e) {
        try {
            return Double.valueOf(value.toString()).intValue();
        } catch (Exception e1) {
            return defaultValue;
        }
    }
}

From source file:Main.java

public static double getDPI(Activity activity) {
    return calculateDPI(getWidth(activity), getHeight(activity),
            Double.valueOf(new DecimalFormat("#.##").format(getScreenSize(activity))));
}

From source file:Main.java

public static Double get_double(Element element, String name) {
    Double d = null;/*from   w  ww  . j  ava  2  s .  com*/
    NodeList list = element.getElementsByTagName(name);
    if (list.getLength() > 0) {
        try {
            d = Double.valueOf(list.item(0).getTextContent());
        } catch (NumberFormatException e) {
            System.err.println(e);
            return null;
        }
    } else {
        System.err.println("No \"" + name + "\" defined");
        return null;
    }

    return d;
}

From source file:Main.java

public static double densoFormula2() {
    double rs = 0;

    double h3 = Double.valueOf(DATA_MAP.get("h3"));
    double h4 = Double.valueOf(DATA_MAP.get("h4"));
    double h5 = Double.valueOf(DATA_MAP.get("h5"));

    rs = h4 + h3 - (h5 - DENSO_VF / 43) + DENSO_AH + DENSO_RAG;

    return rs;/* w  ww. j  a  v a 2  s . c o  m*/
}

From source file:Main.java

public static Double diff(Object o1, Object o2) {
    Double returnVal = Double.valueOf(0);
    if (o1 == null || o2 == null)
        return returnVal;
    Double val1 = Double.valueOf(0);
    Double val2 = Double.valueOf(0);
    if (o1 instanceof Double) {
        val1 = (Double) o1;
    } else {/*  w  w w. ja  v  a  2s. c o  m*/
        val1 = string2double(o1.toString());
    }

    if (o2 instanceof Double) {
        val2 = (Double) o2;
    } else {
        val2 = string2double(o2.toString());
    }

    returnVal = val1 - val2;
    return returnVal;
}