Download MetaTrader 5
To add comments, please log in or register
Publish your articles and improve your rating!
Christian Köchy
36
Christian Köchy 2014.02.05 17:44 
is there a difference between DoubleToStr and DoubleToString?
Simon Gniadkowski
Moderator
17963
Simon Gniadkowski 2014.02.05 17:58  
shck:
is there a difference between DoubleToStr and DoubleToString?
Yes, please read about them in the MetaEditor help file.
Christian Köchy
36
Christian Köchy 2014.02.05 18:18  
RaptorUK:
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.
ydrol
595
ydrol 2014.02.05 18:24  
There doesn't appear to be much - except a default of 8 and a mistake in the documentation 'int value'?
Alain Verleyen
Moderator
28658
Alain Verleyen 2014.02.05 19:00  
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

Christian Köchy
36
Christian Köchy 2014.02.05 20:11  
angevoyageur:

There is no difference, to 2 functions are exactly the same. Only documentation is different.


Is there a reason for two identical functions? Which would be the best choice for the future?
Ubzen
Moderator
5394
Ubzen 2014.02.05 20:57  
shck: Is there a reason for two identical functions? Which would be the best choice for the future?
Probably the new one.
Simon Gniadkowski
Moderator
17963
Simon Gniadkowski 2014.02.05 20:58  
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.
/
To add comments, please log in or register