Download MetaTrader 5
To add comments, please log in or register
MQL5 library has more than 1500 apps already. Contribute your own one!
Saravanakumar D
357
Saravanakumar D 2015.10.12 11:49 

Dear Friends. and Traders.

int idigits = MarketInfo(Symbol(),MODE_DIGITS);

string close_val = DoubleToStr(iClose(cysymbol,cur_tf,i),idigits-1);

when i use this code it automatically round up the value. for example if the vale is 1.45678 the result is being as 1.4568... but i want 1.4567

any one kindly guide me.

sorry for my bad english


with Thanks and Regards

Saravana

whroeder1
13599
whroeder1 2015.10.12 12:09  
string close_val = DoubleToStr(iClose(cysymbol,cur_tf,i),idigits);  // 1.45678
close_val = StringSubstring(close_val, 0, StringLen(lose_val) - 1); // 1.4567
Saravanakumar D
357
Saravanakumar D 2015.10.12 12:24  
WHRoeder:

Thank you so much for the assist bro.. Have a great day.


with Regards

Saravana

Saravanakumar D
357
Saravanakumar D 2015.10.17 09:55  

Bro i would like to add some "xxx" in that last value after i got StringLen modified.

 for example. in your code

string close_val = DoubleToStr(iClose(cysymbol,cur_tf,i),idigits);  // 1.45678
close_val = StringSubstring(close_val, 0, StringLen(lose_val) - 1); // 1.4567

it gives result 1.4567 and i want add 3 some more values after that like 1.4567xxx

the xxx value is constant string...

could you please guide me in this?

With Thanks and Regards

Saravana
/
To add comments, please log in or register