code: public static Constraint digits(final Number integer, final Number fraction) {
  		return new Constraint("digits", digitsPayload(integer, fraction)) {
  			public boolean isValid(Object actualValue) {
  				if (actualValue != null) {
  					if (!((actualValue instanceof Number) || (actualValue instanceof String))) {
  						return false;
  					} else {
  						if (integer != null && fraction != null) {
  							String val = actualValue.toString();
  							String[] split = val.split("[,.]");
  							if (!NumberUtils.isDigits(split[0])) {
  								return false;
  							}
  							if (integer.intValue() < split[0].length()) {
  								return false;
  							}
  							if (split.length > 1 && fraction.intValue() < split[1].length()) {
  								return false;
  							}
  						}
  					}
  				}
  				return true;
  			}
  		};
  	}
docs: The 'digits' constraint - field must be a {@link Number} or {@link String} containing digits where the
  number of digits in the integral part is limited by 'integer', and the
  number of digits for the fractional part is limited
  by 'fraction'.
  @param integer the max number of digits for the integral part
  @param fraction the max number of digits for the fractional part
  @return constraint