That is correct, 21 points displayed as a double.
Use DoubleToString() in your Print.
ie DoubleToString(ASK-BID,Digits)
Keith Watford:
That is correct, 21 points displayed as a double.
Use DoubleToString() in your Print.
ie DoubleToString(ASK-BID,Digits)
I am confused,
ASK-BID should be 0.00021,
but it shows 0.000209999999998214..
I store the ASK-BID in array, and output it (0.00020999999)
Hao-Wei Lee:
I am confused,
ASK-BID should be 0.00021,
but it shows 0.000209999999998214..
I store the ASK-BID in array, and output it (0.00020999999)
I have already given you the answer.
Keith Watford:
Print( DoubleToString(ASK-BID,Digits));
ie DoubleToString(ASK-BID,Digits)
Hao-Wei Lee: but it shows 0.000209999999998214..
| Floating point has infinite number of decimals, it's your not understanding floating point and that some numbers can't be represented exactly. (like 1/10.) Double-precision floating-point format - Wikipedia, the free encyclopedia See also The == operand. - MQL4 forum |
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
I output the value, Spread should be = ASK - BID
MT4 Build 1065