Hi friends,
I want to see and calculate only 5 digit but it creates 15 digit ! How can i reduce the total digit anyone know?
For Prints, Alerts, Comments etc use DoubleToString().
Floating-point has an infinite number of decimals, it's you, not understanding floating-point and that some numbers can't be represented exactly. (like 1/10.s)
Double-precision floating-point format - Wikipedia
See also The == operand. - MQL4 programming forum 2013.06.07
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
I coulnd't able to make it but thank you for replys Mr Watford and Mr Roeder.
Best regards.
Hi friends,
I want to see and calculate only 5 digit but it creates 15 digit ! How can i reduce the total digit anyone know?
void OnTick() { //--- double Sonucma12=ma12 () ; Print(Symbol()+" MA12 Sonucu:"+DoubleToStr(Sonucma12,_Digits)); Comment ( "Close :" + DoubleToStr(Close[0],_Digits), "\n ma 12" + ":" +DoubleToStr(ma12(),_Digits) ); } //+------------------------------------------------------------------+ double ma12 () { double ma12 = iMA(_Symbol,_Period,12,0,MODE_EMA,PRICE_MEDIAN,0); return ma12; } // Comment ( "Close :" + Close[0], // "\n ma 12 :" + ma12() // );
Thank you dear Mehmet.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi friends,
I want to see and calculate only 5 digit but it creates 15 digit ! How can i reduce the total digit anyone know?