short answer is: just use NormalizeDouble(dVal,2)
the function looks at the third decimal digit and if >= 5 then propagate round up leftwards.
ie, this function ONLY ever rounds starting from the,int Digits)'th + 1 digit position.
eg, 1.125 -> 1.13 as expected. But 1.1245 -> 1.12, because the 4, in Digits+1 position is <5
IF you interested in digits 4,5,6,... propagating leftwards then you must do other stuff. I not know about that stuff. But NormalizeDouble() and me = good friends and anyway, you can so easily test out yourself by using Print(...) in quicky script.
hth
btw SM, have you read the MQL Book?
many of the questions you been rapidly posting here are ALL covered...
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
How do you round a number to 2 decimal places in MQL4?
MathROund only does it to integers and has no input fordecimal places?????