@sumaris-net/ngx-components 2.4.77 → 2.4.78-rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/src/app/shared/validator/validators.mjs +5 -5
- package/fesm2015/sumaris-net.ngx-components.mjs +4 -4
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +4 -4
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -3685,14 +3685,14 @@ class SharedValidators {
|
|
|
3685
3685
|
* @param precision
|
|
3686
3686
|
*/
|
|
3687
3687
|
static precision(precision) {
|
|
3688
|
-
if (precision
|
|
3689
|
-
throw new Error('
|
|
3688
|
+
if (isNil(precision))
|
|
3689
|
+
throw new Error('Required a not nil precision');
|
|
3690
3690
|
return (control) => {
|
|
3691
3691
|
const value = control.value;
|
|
3692
|
-
if (
|
|
3692
|
+
if (isNilOrBlank(value) || Number.isNaN(value)) {
|
|
3693
3693
|
return null;
|
|
3694
3694
|
}
|
|
3695
|
-
if (value % precision !== 0) {
|
|
3695
|
+
if (+value % precision !== 0) {
|
|
3696
3696
|
return { precision: { precision } };
|
|
3697
3697
|
}
|
|
3698
3698
|
return null;
|