public static final int extractInteger(String buffer, int def, boolean localized) {
		buffer = normalizeNumber(buffer, localized);
		if (hasDecimalSeparator(buffer, localized)) {
			return (int) extractDouble(buffer, def, localized);
		}
		int 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);
		}
		int max = Integer.MAX_VALUE / multiplier;
		int min = Integer.MIN_VALUE / multiplier;
		try {
			int value = Integer.parseInt(buffer);
			if (value > max) {
				value = max;
			} else if (value < min) {
				value = min;
			}
			return value * multiplier;
		} catch (Exception exception) {
			return def;
		}
	}