Java Utililty Methods Double Convert to

List of utility methods to do Double Convert to

Description

The list of methods to do Double Convert to are organized into topic(s).

Method

doubleconvertDouble(Object param)
convert Double
return new Double(param.toString());
DoubleconvertDouble(String str)
convert Double
double val = 0;
try {
    val = Double.parseDouble(str);
} catch (NumberFormatException ex) {
return new Double(val);
doubleconvertDouble(String str, double defaults)
convert Double
if (str == null) {
    return defaults;
try {
    return Double.parseDouble(str);
} catch (Exception e) {
    return defaults;
double[]convertDouble2double(final Double[] pArray)
convert Doubledouble
final double[] lNewArray = new double[pArray.length];
for (int i = 0; i < pArray.length; i++) {
    lNewArray[i] = pArray[i].doubleValue();
return lNewArray;
StringconvertDoubleArrayToString(double[] value, String separator)
convert Double Array To String
if (value.length == 0) {
    return "";
StringBuilder sb = new StringBuilder();
for (double v : value) {
    sb.append(v);
    sb.append(separator);
sb.setLength(sb.length() - separator.length());
return sb.toString();
voidconvertDoubleConsonant(byte[] b)
convert Double Consonant
int len = b.length;
if ((len & 1) == 1) {
    b[len - 1] = '\0';
    len--;
for (int i = 0; i < len; i += 2) {
    int high = b[i] & 0xff;
    int low = b[i + 1] & 0xff;
...
doubleconvertDoubleFromBytes(final byte[] bytes)
convert Double From Bytes
return convertDoubleFromBytes(bytes, 0);
StringconvertDoubleIntoHexadecimalString(double value, int precision)
convert Double Into Hexadecimal String
double fractionValue = value % 1;
int intValue = (int) (value - fractionValue);
String str = Integer.toHexString(intValue);
if (fractionValue != 0) {
    str += ".";
    StringBuilder dec = new StringBuilder();
    while ((fractionValue *= 16) != 0 && dec.length() < precision) {
        double temp = fractionValue % 1;
...
double[]convertDoubleList(Double[] list)
convert Double List
if (list == null)
    return null;
double[] result = new double[list.length];
for (int i = 0; i < list.length; i++)
    result[i] = list[i].doubleValue();
return result;
float[][]convertDoubleMatrixToFloat(double[][] input, int dimRows, int dimColoumns)
convert Double Matrix To Float
if (input == null) {
    return null; 
float[][] output = new float[dimRows][dimColoumns];
for (int i = 0; i < dimRows; i++) {
    for (int j = 0; j < dimColoumns; j++) {
        output[i][j] = (float) input[i][j];
return output;