data type double, number places after the period
Comment(DoubleToStr(askk, Digits));
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. |
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?