errorcodes:
Hi~
I've got a simple problem for using the function DoubleToStr().
Result >>## DoubleToStr Test 3 ##
D1 : 1.2345
DoubleToStr(1.2345,3) : 1.234
DoubleToStr(D1,3) : 1.234
S1 = DoubleToStr(D1,3): 1.234
ND1 = StrToDouble(S1) : 1.234
------------------------
D2 : 1.2346
DoubleToStr(1.2346,3) : 1.235
DoubleToStr(D2,3) : 1.235
S2 = DoubleToStr(D2,3): 1.235
Looks like it's working just fine. What's your problem?
Look at the description of DoubleToStr and NormalizeDouble Only Norm rounds.
Yes. Thanks.
I expected that the S1 also would be "1.235".
(Sorry for my english... )
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
Hi~
I've got a simple problem for using the function DoubleToStr().
Just don't want to get this again ...
Source>>
//----
double D1 = 1.2345;
string S1 = DoubleToStr(D1,3);
double ND1 = StrToDouble(S1);
Print("## DoubleToStr Test 3 ##");
Print("D1 : ",D1);
Print("DoubleToStr(1.2345,3) : ", DoubleToStr(1.2345,3));
Print("DoubleToStr(D1,3) : ", DoubleToStr(D1,3));
Print("S1 = DoubleToStr(D1,3): ", S1);
Print("ND1 = StrToDouble(S1) : ", ND1);
//----
double D2 = 1.2346;
string S2 = DoubleToStr(D2,3);
Print("------------------------");
Print("D2 : ",D2);
Print("DoubleToStr(1.2346,3) : ", DoubleToStr(1.2346,3));
Print("DoubleToStr(D2,3) : ", DoubleToStr(D2,3));
Print("S2 = DoubleToStr(D2,3): ", S2);
Result >>
## DoubleToStr Test 3 ##
D1 : 1.2345
DoubleToStr(1.2345,3) : 1.234
DoubleToStr(D1,3) : 1.234
S1 = DoubleToStr(D1,3): 1.234
ND1 = StrToDouble(S1) : 1.234
------------------------
D2 : 1.2346
DoubleToStr(1.2346,3) : 1.235
DoubleToStr(D2,3) : 1.235
S2 = DoubleToStr(D2,3): 1.235