Was just doing some one shot/hotKeyed Buy,Sell scripts with TrailStops and thot would be fun to see comment area 'objects' which changed in sympathy to open trade.
Was thinking how great to trim rightmost zero decimal digits. Unable to source it so...
After a bit came up with below.
Anyway... might be of use or give 'ideas' ;
.
//string dPrint (double d,bool bTR=false){return(iifs(bTR,sTrimRightZeros(d),DoubleToStr(d,Digits)));}//string sTrimRightZeros (double dVal){string s = dVal;int iDPofst =StringFind(s,".",0);if(iDPofst==-1)return(dVal);//no can do. no DPint iCh ='0';//init for first loop cond testfor(int i=StringLen(s)-1;i>iDPofst && iCh=='0';i--)
iCh =StringGetChar(s,i);return(StringSubstr(s,0,i+2));}//sTrimRightZeros()
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Was just doing some one shot/hotKeyed Buy,Sell scripts with TrailStops and thot would be fun to see comment area 'objects' which changed in sympathy to open trade.
Was thinking how great to trim rightmost zero decimal digits. Unable to source it so...
After a bit came up with below.
Anyway... might be of use or give 'ideas' ;
.