- CharToString
- CharArrayToString
- CharArrayToStruct
- StructToCharArray
- ColorToARGB
- ColorToString
- DoubleToString
- EnumToString
- IntegerToString
- ShortToString
- ShortArrayToString
- TimeToString
- NormalizeDouble
- StringToCharArray
- StringToColor
- StringToDouble
- StringToInteger
- StringToShortArray
- StringToTime
- StringFormat
NormalizeDouble
Rounding floating point number to a specified accuracy.
double NormalizeDouble(
|
Parameters
value
[in] Value with a floating point.
digits
[in] Accuracy format, number of digits after point (0-8).
Return Value
Value of double type with preset accuracy.
Note
Calculated values of StopLoss, TakeProfit, and values of open prices for pending orders must be normalized with the accuracy, the value of which can be obtained by Digits().
Please note that when output to Journal using the Print() function, a normalized number may contain a greater number of decimal places than you expect. For example, for:
double a=76.671; // A normalized number with three decimal places
|
you will have the following in the terminal:
DoubleToString(a,8)=76.67100000 Print(76.671)=76.67100000000001 |
Example:
double pi=M_PI;
|
See also