Problem with coding, please help
Strings aren't numbers.
if(MathAbs(d2-d1)/Pip > 8.0){ // <---- here you have to use a numerical value for comparison if(z == 0){ Alert(DoubleToStr(MathAbs(d2-d1)/Pip,1)); // <---- here you can keep the string z = 1; } }
or using NormalizeDouble if you really want it to be a 1 digit :
if(NormalizeDouble(MathAbs(d2-d1)/Pip,1) > 8.0){ if(z == 0){ Alert(DoubleToStr(MathAbs(d2-d1)/Pip,1)); z = 1; } }
Icham Aidibe:
Strings aren't numbers.
or using NormalizeDouble if you really want it to be a 1 digit :
perfect. It works now. Thank you very much.
At this point it is not a problem.
I have problem with my coding. Why DoubleToString only accept value from 0.0 to 9.9 only? Why cannot accept 10.0 to 30.0? Hopefully any expert can help me out. I have attach the screenshots.