When I convert a null string ("") to a double, what should I be getting in the double? A null value or a zero?
- Fibonacci values??
- DoubleToStr() is not working in Moving Average value. I want to display the MA value in 5 digits
- Does StrToDouble() return only 4 digits?
try this:
Print("What do I get? ", StrToDouble("",2));
gifog:
When I convert a null string ("") to a double, what should I be getting in the double? A null value or a zero?
When I convert a null string ("") to a double, what should I be getting in the double? A null value or a zero?
Technically speaking, a null string (NULL) and an empty string ("") are two different values.
An example using an empty string:
double var1 = StrToDouble(""); Print(var1);
An example using a null string:
double var1 = StrToDouble(NULL); Print(var1);
However, it seems they both get a double (data type) value of 0.
This may be relatively true with EA's Metaquotes language.
But with other programming languages, such as C++ or Java, NULL and "" are NOT the same value; nor would they produce the same results.
Thank you for both answers.
I never thought of just printing the results to see what I get - and over the weekend ticks do not happen, so my program wouldn't show anything.
And thank you for testing/printing the results for me as well ('both ...value of 0).
I never thought of just printing the results to see what I get - and over the weekend ticks do not happen, so my program wouldn't show anything.
And thank you for testing/printing the results for me as well ('both ...value of 0).
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register