is there a way to convert double to string with only 2 digits after decimal point (instead of 8 by default) ?

 

No problem with statement like this:

Comment(Bid);

But there is a disturb in case like this:

string subject="Bid = "+Bid;

SendMail(subject,"");

// Result in: Bid=1770.12000000 instead of 1770.12 
// the result would still be the same in case of replacing Bid by NormalizeDouble(Bid,2) or by DoubletoStr(Bid)


Thanks for any help

 
dahumeovn:


No problem with statement like this:

But there is a disturb in case like this:

So you want to convert a double to a string ? did you check the conversion functions ? maybe something called DoubleToStr() ?
 
dahumeovn:

No problem with statement like this:

But there is a disturb in case like this:

Thanks for any help

Hi dahumeovn,

You already mention DoubleToStr, check again that definition and its parameter please https://docs.mql4.com/convert/DoubleToStr

 

ok

NormailizeDouble still remain zeros afterwards but DoubletoStr doesn't.

Thank for your remind.