# how to find the round numbers

How to use MQL5.community messages editor? Find out in the article!
481
2014.08.05 07:52

HI all, I need to build a control to find this situation

If (Bid contains 0.0010 or 0.0090) then (...)

For instance bid is 1.3810 or 1.3890. How can I isolate the 10 and 90 round numbers?

Thank you!

Moderator
7908
2014.08.05 08:35

Not sure, maybe something like this will do it?

Odd! SRC won't work with this post for some reason!

Moderator
7908
2014.08.05 08:36
``` double B=Bid;
if(Digits==5 ||Digits==4)
{
double r=NormalizeDouble(B-(MathFloor(B*100)/100),5);
if(r==0.0090 || r==0.0010)
Print("true");
}```
13616
2014.08.05 14:11
1.  GumRai: Odd! SRC won't work with this post for some reason! Happens sometimes (JS gets confused.) Copy what you need (the html,) back out of the edit form, control-refresh, edit again.
2. ```    double r=NormalizeDouble(B-(MathFloor(B*100)/100),5);
if(r==0.0090 || r==0.0010)
```
This fails on JPY where digits < 4. This is also subject to floating equals problems The == operand. - MQL4 forum
3. ```int BidPips = int(Bid / pips2dbl) % 100;
if( BidPips == 90 || BidPips == 10) ...
```
2583
2014.08.06 02:44

WHR your code will introduce a rounding error of 1 pip sometimes too

13616
2014.08.06 12:22
 SDC: WHR your code will introduce a rounding error of 1 pip sometimes too Yep, probably should round to nearest pip`int BidPips = int(Bid / pips2dbl + 0.5) % 100;`
/