MQL4 Reference
Conversion functions
NormalizeDouble
| 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
|
|
|