From 556df8e6c62c7939668c93cc9116cc366f0d2d6d Mon Sep 17 00:00:00 2001 From: crisnicandrei <62384997+crisnicandrei@users.noreply.github.com> Date: Tue, 25 Jul 2023 23:02:19 +0300 Subject: [PATCH] PER-9237 Fixed the integer validator so numbers such as 2.0 do not pass the check --- .../core/components/gift-storage/gift-storage.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/core/components/gift-storage/gift-storage.component.ts b/src/app/core/components/gift-storage/gift-storage.component.ts index 54277e4e2..9d0d73e68 100644 --- a/src/app/core/components/gift-storage/gift-storage.component.ts +++ b/src/app/core/components/gift-storage/gift-storage.component.ts @@ -88,6 +88,8 @@ export class GiftStorageComponent implements OnDestroy { integerValidator(control: FormControl) { const isInteger = Number.isInteger(Number(control.value)); - return isInteger ? null : { notInteger: true }; + const hasDecimalPoint = control.value.toString().includes('.'); + + return isInteger && !hasDecimalPoint ? null : { notInteger: true }; } }