Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions lib/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down