Programming Problem (MM) ! - page 2

 
Mohammad Soubra:
All not solve the trick
But thanks for all tries

Of course they solve it.

Those are not 'tries' those are working examples.

 

This modified NormalizeDouble() should work.

double NormalizeDouble(int digits,double value)
  {
   long iValue=long(value*MathPow(10,digits));
   double dValue=iValue/MathPow(10,digits);
   return(dValue);
  }
  
Print(NormalizeDouble(0.015,2));
Print(NormalizeDouble(2,0.015));

2016.08.16 10:21:03.234 test EURUSD,H1: 0.02
2016.08.16 10:21:03.235 test EURUSD,H1: 0.01
Reason: