Help with a conversion

 

Please i need help with a conversion, I have the following code


string simbol = "AUDJPY";

double diferenc;
double alto = 102.913;
double bajo = 101.311;
int resul = 70;
double diferenc_H_L;

//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
   diferenc_H_L = alto - bajo;
   diferenc = (diferenc_H_L * resul) / 100;
   Alert ("before conversion... ", diferenc);
  
   diferenc = NormalizeDouble(diferenc,MarketInfo(simbol,Digits));
   Alert ("after conversion... ", diferenc);
   return(0);

  }


value of diferenc before the conversion = 1.1214

value of diferenc after the conversion = 1

I need that the value is 3 decimal places (1.121), are those AUDJPY on my shelf, but it does not work properly can anyone help?. Thank you.

 
   double diferenc2 = NormalizeDouble(diferenc,MarketInfo(simbol,MODE_DIGITS));
   Alert ("after conversion... ", diferenc2);
 

Thank you so much deVries...

 
jugivi:

Please i need help with a conversion, I have the following code

<CODE REMOVED>


Please edit your post . . .    please use the   SRC   button to post code: How to use the   SRC   button. 
 
Excuse me, what's the difference between using MODE_DIGITS or Digits?
 
jugivi: what's the difference between using MODE_DIGITS or Digits?
MODE_DIGITS or Digits?
Reason: