Code from Indicator to EA - "WARNING" implicit conversion from 'number' to 'string'

 

I have taken this code from an indicator and placed it into my EA so I can see the Bar Timer countdown

Yet I have 3 Warnings - implicit conversion from 'number' to 'string'    + h + ":" + m + ":" + s,

I would like to correct/remove these warnings All help appreciated.


   int ttc, d, h, m, s, rest;
   
   ttc = Time[0] + Period()*60 - TimeCurrent();
   
   rest=ttc%86400;
   d=(ttc-rest)/86400;
   ttc=rest;
   rest=ttc%3600;
   h=(ttc-rest)/3600;
   ttc=rest;
   rest=ttc%60;
   m=(ttc-rest)/60;
   s=rest;
   ObjectSetText("lineti", "Bar: " + h + ":" + m + ":" + s, 11, "Tahoma", sqLabelColor); 
 
Ray Eagle: implicit conversion from 'number' to 'string'    + h + ":" + m + ":" + s,

So stop doing that. Convert your variables to a string before concatenation. Or use StringFormat.

 

Thank you William for your fast reply,

Ok, understand I hope


ObjectSetText("lineti", "Bar: "+StringConcatenate( "", h, ":", m, ":", s, "" ));