Floating-point has an 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 programming forum
If you want to see the correct number of digits, convert it to a string with the correct/wanted accuracy.
question about decima of marketinfo() - MQL4 programming forum 2016.05.18
NormalizeDouble returns a double.
Floating-point has an 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 programming forum
If you want to see the correct number of digits, convert it to a string with the correct/wanted accuracy.
question about decima of marketinfo() - MQL4 programming forum 2016.05.18
Ok thanks, so if I understanding you, I should be converting it to a string and using PrintFormat to do this?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Yes, i have read: https://www.mql5.com/en/docs/convert/normalizedouble#
No, not a programmer.. just trying to do a simple change.
Print("Point A: " + NormalizeDouble(m_LastSwingPoints[3].swingValue, Digits() - 1));
Output: 0.9641999999999999
How can i get this down to 4 digits after the decimal?