- You can do it mathematically on your own: (int(79.77739518770201*10000.0 + 0.5))/10000.0;
- You can use MQ-functions (seach with F1 for MathRound or MathFloor): MathFloor(79.77739518770201*10000.0 + 0.5)/10000.0 or MathRound(79.77739518770201*10000.0 )/10000.0
- Or you want see as a text number: DoubleToString( 79.77739518770201, 4)
(Not tested!)
pekele4u: reduce this number 79.77739518770201 to four places of decimal, that is it will
be 79.7773
int OnInit(){ double n=79.77739518770201; Print( MathNearest(n, 0.0001) ); // 79.7774MT4:NormalizeDouble - General - MQL5 programming forum
How to Normalize - Expert Advisors and Automated Trading - MQL5 programming forum
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
please what piece of code can i use to reduce this number 79.77739518770201 to four places of decimal, that is it will be 79.7773
I don't know whether MathCell can do it.