OCA_Backend/api/node_modules/validator/es/lib/isDivisibleBy.js

6 lines
202 B
JavaScript
Raw Normal View History

2022-01-22 13:36:44 +00:00
import assertString from './util/assertString';
import toFloat from './toFloat';
export default function isDivisibleBy(str, num) {
assertString(str);
return toFloat(str) % parseInt(num, 10) === 0;
}