is there a difference between DoubleToStr and DoubleToString?
shck:
is there a difference between DoubleToStr and DoubleToString?
Yes, please read about them in the MetaEditor help file.
is there a difference between DoubleToStr and DoubleToString?
RaptorUK:
Yes, please read about them in the MetaEditor help file.
Yes, please read about them in the MetaEditor help file.
I had already looked there and at first glance I saw no difference, so I asked here for it.
There doesn't appear to be much - except a default of 8 and a mistake in the documentation 'int value'?
shck:
I had already looked there and at first glance I saw no difference, so I asked here for it.
There is no difference, to 2 functions are exactly the same. Only documentation is different.
Print("double To String(120.0 + M_PI) : ",DoubleToString(120.0+M_PI)," <=> ",DoubleToStr(120.0+M_PI)); Print("double To String(120.0 + M_PI,16) : ",DoubleToString(120.0+M_PI,16)," <=> ",DoubleToStr(120.0+M_PI,16)); Print("double To String(120.0 + M_PI,-16) : ",DoubleToString(120.0+M_PI,-16)," <=> ",DoubleToStr(120.0+M_PI,-16)); Print("double To String(120.0 + M_PI,-1) : ",DoubleToString(120.0+M_PI,-1)," <=> ",DoubleToStr(120.0+M_PI,-1)); Print("double To String(120.0 + M_PI,-20) : ",DoubleToString(120.0+M_PI,-20)," <=> ",DoubleToStr(120.0+M_PI,-20));
2014.02.05 19:58:12.211 _template EURUSD,M1: double To String(120.0 + M_PI,-20) : 1.231416e+002 <=> 1.231416e+002
2014.02.05 19:58:12.211 _template EURUSD,M1: double To String(120.0 + M_PI,-1) : 1.2e+002 <=> 1.2e+002
2014.02.05 19:58:12.211 _template EURUSD,M1: double To String(120.0 + M_PI,-16) : 1.2314159265358980e+002 <=> 1.2314159265358980e+002
2014.02.05 19:58:12.211 _template EURUSD,M1: double To String(120.0 + M_PI,16) : 123.1415926535897967 <=> 123.1415926535897967
2014.02.05 19:58:12.211 _template EURUSD,M1: double To String(120.0 + M_PI) : 123.14159265 <=> 123.14159265
shck: Is there a reason for two identical functions? Which would be the best choice for the future?
Probably the new one.
shck:
Is there a reason for two identical functions? Which would be the best choice for the future?
One is for backwards compatibility with old mql4 the other for compatibility with mql5.
Is there a reason for two identical functions? Which would be the best choice for the future?
Sorry for reopening this thread, but I think it needs to be clarified. They have a difference on the decimal digits allowed. DoubleToStr allows up to 8 digits, meanwhile DoubleToString allows up to 16 decimal digits

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