Comment(DoubleToStr(askk, Digits));
c0d3 wrote >>
since IBFX is now with 5 decimal places, for some reason when i declare double, the values have 4 decimal places.
example
Ask price: 1.31475
double askk=Ask; Comment(askk);
//the comment only contains 4 decimal places, 1.3147
Is there a way to add more decimal places to a double datatype?
Try:
double askk=Ask;
Comment(DoubleToStr(askk,5));
The issue is not the double cast, it is the comment function. Read this description of Comment() from the docs (it automatically truncates doubles to 4 digits):
---------------------------------------------------------------------------------------------------------------------------------------
Arrays cannot be passed to the Comment() function. Arrays should be output elementwise. Data of double type output with 4 digits after the decimal point. To output with more precision, use the DoubleToStr() function. Data of bool, datetime and color types will be output as their numeric presentation. To output values of datetime type as strings, convert them with the TimeToStr() function. |
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
since IBFX is now with 5 decimal places, for some reason when i declare double, the values have 4 decimal places.
example
Ask price: 1.31475
double askk=Ask; Comment(askk);
//the comment only contains 4 decimal places, 1.3147
Is there a way to add more decimal places to a double datatype?