Help with "implicit conversion from 'number' to 'string'"

 

If someone could help me solve this warning it would be greatly appreciated,

The code works correctly yet I get the "implicit conversion from 'number' to 'string'" warning

   extern double  SpreadRed = 1.0;

   double spreadActual=(Ask-Bid)/Point/nn;
   string spreadValue=DoubleToStr(spreadActual,1);
   if(spreadValue>SpreadRed) spreadColor=spreadHighColor;
   else if(spreadValue<SpreadRed) spreadColor=spreadLowColor;
   else spreadColor=LimeGreen;
 
Ray Eagle:

If someone could help me solve this warning it would be greatly appreciated,

The code works correctly yet I get the "implicit conversion from 'number' to 'string'" warning

you are comparing a string value with a double value therefore the compiler has converted the double to a string to allow it to happen, is that what you really want though

 else if(spreadValue<SpreadRed) spreadColor=spreadLowColor;
 
Ray Eagle:

If someone could help me solve this warning it would be greatly appreciated,

The code works correctly yet I get the "implicit conversion from 'number' to 'string'" warning

Why use spreadValue (which is a string) instead of spreadActual?
 

Thank you Paul Anscombe & Thank-god Avwerosuoghene Odukudu,

Yes yes I see now Thank you again 👍😊

"I see said the blind man peeing into the wind its all coming back to me now"
Reason: