class UnitNormalizer {

    public static double getNormalizedNumber(String unitText) throws NumberFormatException, NullPointerException {

        // add space in case it's missing "2.4Ghz" => "2.4 Ghz"
        unitText = unitText.replaceAll("(\\d)([A-Za-z\"])", "$1 $2").trim();
        String words[] = unitText.split(" ");

        if (words.length == 0) {
            words = unitText.trim().split("(?<=[0-9])(?=\\w)");
        }

        double number = Double.parseDouble(words[0]);

        String newUnitText = "";
        for (int i = 1; i < words.length; i++) {
            newUnitText += words[i] + " ";
        }
        return getNormalizedNumber(number, newUnitText.trim(), 3, "");
    }

}