/*
 * Decompiled with CFR 0.152.
 */
package com.hst.common.util;

import java.text.DecimalFormat;

public class DecimalFormatUtil {
    public static String DecimalFormat(String num, String format) {
        if ("".equals(num) || num == null) {
            return "";
        }
        DecimalFormat df = new DecimalFormat(format);
        double d = Double.valueOf(num);
        String value = df.format(d);
        return value;
    }

    public static String DecimalFormat(String num) {
        if ("".equals(num) || num == null) {
            return "";
        }
        DecimalFormat df = new DecimalFormat("0.00");
        double d = Double.valueOf(num);
        String value = df.format(d);
        return value;
    }

    public static String DecimalFormat(double num, String format) {
        if ("".equals(num)) {
            return "";
        }
        DecimalFormat df = new DecimalFormat(format);
        String value = df.format(num);
        return value;
    }

    public static String DecimalFormat(double num) {
        if ("".equals(num)) {
            return "";
        }
        DecimalFormat df = new DecimalFormat("0.00");
        String value = df.format(num);
        return value;
    }

    public static double DcDecimalFormat(String num, String format) {
        if ("".equals(num) || num == null) {
            return 0.0;
        }
        DecimalFormat df = new DecimalFormat(format);
        String d = df.format(Double.parseDouble(num));
        double value = Double.parseDouble(d);
        return value;
    }

    public static double DcDecimalFormat(String num) {
        if ("".equals(num) || num == null) {
            return 0.0;
        }
        DecimalFormat df = new DecimalFormat("0.00");
        double d = Double.parseDouble(num);
        String s = df.format(d);
        double value = Double.parseDouble(s);
        return value;
    }

    public static double DcDecimalFormat(double num, String format) {
        if ("".equals(num)) {
            return 0.0;
        }
        DecimalFormat df = new DecimalFormat(format);
        String d = df.format(num);
        double value = Double.parseDouble(d);
        return value;
    }

    public static double DcDecimalFormat(double num) {
        if ("".equals(num)) {
            return 0.0;
        }
        DecimalFormat df = new DecimalFormat("0.00");
        String d = df.format(num);
        double value = Double.parseDouble(d);
        return value;
    }
}
