check integer value

 
Hello ,
Is there any way to check if the output is integer or if not
I want to know if this is 5 or 6 not 5.2 nor 6.7

Thank you
 
There's a few different ways to do it depending on what exactly you're trying to achieve. Suggest you research MathMod and MathFloor to get some ideas
 
Mohamed Mohamed: s there any way to check if the output is integer or if not I want to know if this is 5 or 6 not 5.2 nor 6.7
  1. Some numbers can't be represented exactly. (like 1/10.) Double-precision floating-point format - Wikipedia, the free encyclopedia  See also The == operand. - MQL4 forum
    bool isInteger = MathAbs(int(d) - d) < _Point;
  2. What do you mean by "output?"
 
it's for volume_step checking
My code will round the wrong value automatically but I want to show a warning message so I will divide that Lot size by the step and if it's not integer so I will show that message
 
honest_knave:
Doesn't answer the question
 
Alain Verleyen:
Doesn't answer the question

Indeed it doesn't! But it may give the OP a different approach 

Edit... hmm, just read his post more carefully. You're right

 
honest_knave:

Indeed it doesn't! But it may give the OP a different approach 

Edit... hmm, just read his post more carefully. You're right


I don't understand what do u mean ?

 

I removed the code I posted because I hadn't properly read what you wanted.

The way ahead is still as whroeder1 said: you need to make sure the difference between an integer cast of your double and your double is very small.

 
Aha Thanks guys for your replies I really appreciate it
and thanks again whroeder1 for the idea
Reason: