string DoubleToStr( | double value, int digits) |
string value=DoubleToStr(1.28473418, 5); // the value is "1.28473"
Any solution there? the above is not solution, it is conversion into STRING!!!
It is a solution.
Don't confuse what the number actually is with how you want the number displayed.
There is no difference between 1.2345600000 and 1.23456 except how it is displayed.
Now we are teetering on the edge of 2 forum bugbears - NormalizeDouble and how floating point numbers are stored in binary
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
I'm using NormalizeDouble() to round a number to the 5th decimal place but the problem is that it keeps all the zeroes at the end. For example: 1.2345600000.
How can I trim the number to 5 decimal places, getting rid of the zeroes?