diff --git a/lib/validate.js b/lib/validate.js index 97cbbf6..63aaf9e 100644 --- a/lib/validate.js +++ b/lib/validate.js @@ -179,9 +179,8 @@ var validate = exports._validate = function(/*Any*/instance,/*Object*/schema,/*O addError("does not have a value in the enumeration " + enumer.join(", ")); } } - if(typeof schema.maxDecimal == 'number' && - (value.toString().match(new RegExp("\\.[0-9]{" + (schema.maxDecimal + 1) + ",}")))){ - addError("may only have " + schema.maxDecimal + " digits of decimal places"); + if(typeof schema.divisibleBy == 'number' && (value % schema.divisibleBy !== 0)){ + addError("may be divisible by " + schema.divisibleBy); } } }