ImperialTrader: Sometimes I get the correct price (1.12086) and other times I get a wrong price
(1.1208600000000001)
Wrong, they are both the same exact price.
Double-precision floating-point format - Wikipedia, the free encyclopedia
See also The == operand. - MQL4 programming forum
Print out your values to the precision you want with DoubleToString - Conversion Functions - MQL4 Reference.
William Roeder:
Double-precision floating-point format - Wikipedia, the free encyclopedia
Wrong, they are both the same exact price.
Double-precision floating-point format - Wikipedia, the free encyclopedia
See also The == operand. - MQL4 programming forum
Print out your values to the precision you want with DoubleToString - Conversion Functions - MQL4 Reference.
Ok, thank you.
![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
Hi guys,
I'm using this code to fetch the close price of the previous candle
MqlRates mrate[]; double Close_Price; Close_Price=mrate[1].close;
Sometimes I get the correct price (1.12086) and other times I get a wrong price (1.1208600000000001)
How can I remove all of these extra digits?