MQL4 - automated forex trading   /  

Documentation

MQL4 Reference  Conversion functions  NormalizeDouble

 
Use the opportunities of
MQL5 in MetaTrader 5
Study the new MQL5 language
Study the new MQL5 language.
Reference is already available
double NormalizeDouble( double value, int digits)
Rounds the floating point value to the given precision. Returns normalized value of the double type.
The calculated StopLoss and TakeProfit values, as well as open price of pending orders must be normalized with a precision the value of which is stored in the pre-defined variable of Digits.
Parameters:
value   -   Floating point value.
digits   -   Precision format, number of digits after decimal point (0-8).
Sample:
  double var1=0.123456789;
  Print(DoubleToStr(NormalizeDouble(var1,5),8));
  // output: 0.12346000