How to check if a number is integer or not
zakaria
-
teebo Messages postés 33585 Date d'inscription Statut Contributeur Dernière intervention -
teebo Messages postés 33585 Date d'inscription Statut Contributeur Dernière intervention -
i want to know to check in a program if the user has entered an enteger number or not
5 réponses
-
Hi zakaria, Blux, hi everyone,
Blux... here you are testing whether a number is even! if your number is 3, the test won't be right as
int(3/2)=1 is not equal to 3/2=1,5 however 3 is an integer !
The true test is:
int(number)=number then number is an integer!
@12C4
Ipl -
Hello !
if int(number/2)=number/2 then number is integer...
A+ Blux "Les cons, ça ose tout.
C'est même à ça qu'on les reconnait" -
Hi !!
Try "TypeName" in VB/VBA code (if applicable).... ;-)))
Wild and Free -
-
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question -