/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ht.data.util;

/**
 *
 * @author Administrator
 */
public class Toolkit {
    public static final String xmlnsXLinkNS = "http://www.w3.org/1999/xlink";

    public static double getNumber(Object obj) {

        double number = Double.NaN;

        if (obj != null) {

            if (obj instanceof Double) {

                number = (Double) obj;

            } else if (obj instanceof Float) {

                number = (Float) obj;

            } else if (obj instanceof Integer) {

                number = (Integer) obj;

            } else if (obj instanceof String) {

                try {
                    number = Double.parseDouble((String) obj);
                } catch (Exception ex) {
                }
            }
        }

        return number;
    }
}
