Download MetaTrader 5

how to convert long to string?

To add comments, please log in or register
Reza nasimi
257
Reza nasimi  

Hi
How can I convert long type value  to string?

I tried with IntegerTo String   and got same warning.
Also I checked this page but there is no LongToString or something with "Long" word.


 if(ObjectCreate(ChartID(),"rez",OBJ_TEXT,0,TimeCurrent(),Low[0]-0.0001))
     {

      ObjectSetString(ChartID(),"rez",OBJPROP_TEXT,Volume[2]);// the value of Volume[2] converts to string and works but editor gives warning.
      ObjectSet("rez",OBJPROP_ANGLE,90);
     }

 


Conversion Functions - MQL4 Reference
Conversion Functions - MQL4 Reference
  • docs.mql4.com
Conversion Functions - MQL4 Reference
Yohana Parmi
3536
Yohana Parmi  
Reza nasimi:

Hi
How can I convert long type value  to string?

I tried with IntegerTo String   and got same warning.
Also I checked this page but there is no LongToString or something with "Long" word.


hi Reza,

Did you try this :)

ObjectSetString(ChartID(),"rez",OBJPROP_TEXT,DoubleToString(Volume[2],0));
Reza nasimi
257
Reza nasimi  
Yohana Parmi:

hi Reza,

Did you try this :)


Hi dear Yohana Parmi :)

Thank you very much .
It works without warning now .

Doerk Hilger
1554
Doerk Hilger  

its just simple typecasting using (string), you dont need no function.

string s = (string)longvalue;

Reza nasimi
257
Reza nasimi  
Doerk Hilger:

its just simple typecasting using (string), you dont need no function.

string s = (string)longvalue;

Doerk Hilger:

its just simple typecasting using (string), you dont need no function.

string s = (string)longvalue;



Hi Doerk Hilger.
I saw your comment late but It was very helpful 

Thank you 

To add comments, please log in or register