src/main/java/com/findupon/commons/utilities/NumUtils.java
/**
	 * Attempt to return a meaningful Integer exactly 4 digits in length. and a
	 * {@see #IllegalFormatException} by removing all commas and decimal places prior to returning
	 * {@see Integer.valueOf()}.
	 */
Attempt to return a meaningful Integer exactly 4 digits in length. and a
#IllegalFormatException by removing all commas and decimal places prior to returning
Integer.valueOf().
Attempt to return a meaningful Integer exactly 4 digits in length . and a #IllegalFormatException by removing all commas and decimal places prior to returning Integer . valueOf () .
public static int fourDigitIntFrom(String str) {
		int errorCode = hasErrors(str);
		if(errorCode != NONE) {
			return errorCode;
		}
		if(intFrom(str) == 4) {
			return intFrom(str);
		}
        /*
         * We can make this smarter, make it more directed towards years etc.
         */
		if(intFrom(str) > 4) {
			return Integer.valueOf(str.substring(0, 5));
		}
		return Integer.valueOf(str);
	}
public static int fourDigitIntFrom ( String str ) { int errorCode = hasErrors ( str ) ; if ( errorCode != NONE ) { return errorCode ; } if ( intFrom ( str ) == 4 ) { return intFrom ( str ) ; } /*
         * We can make this smarter, make it more directed towards years etc.
         */ if ( intFrom ( str ) > 4 ) { return Integer . valueOf ( str . substring ( 0 , 5 ) ) ; } return Integer . valueOf ( str ) ; }
Attempt to return a meaningful Integer exactly 4 digits in length.
Attempt to return a meaningful Integer exactly 4 digits in length .