public static final double extractDouble(String buffer, double def, boolean localized) {
		buffer = normalizeNumber(buffer, localized);
		double multiplier = 1;
		if (hasBillionsSuffix(buffer)) {
			multiplier = 1000000000;
			buffer = removeSuffix(buffer);
		} else if (hasMillionsSuffix(buffer)) {
			multiplier = 1000000;
			buffer = removeSuffix(buffer);
		} else if (hasThousandsSuffix(buffer)) {
			multiplier = 1000;
			buffer = removeSuffix(buffer);
		}
		double max = Double.MAX_VALUE / multiplier;
		double min = Double.MIN_VALUE / multiplier;
		try {
			if (localized) {
				char decimal = LOCALIZED_DECIMAL_SEPARATOR.charAt(0);
				if (decimal != '.') {
					buffer = buffer.replace(decimal, '.');
				}
			}
			double value = Double.parseDouble(buffer);
			if (value > max) {
				value = max;
			} else if (value < min) {
				value = min;
			}
			return value * multiplier;
		} catch (Exception exception) {
			return def;
		}
	}