artwarlt:
Hello guys!
Need some help! When using script
Profit = OrderProfit() + OrderCommission();
Comment(Profit);
sometimes getting values like 2.100000000000001 or 2.599999999999999 instead of 2.1 and 2.6.
Please read --> Comment() "Data of double type are output with the accuracy of up to 16 digits after a decimal point . . . To output real numbers with another accuracy or in a predefined format, use the DoubleToString() function."
All the information you need is in the documentation . . . it's much quicker for you to read the documentation than to wait for a reply on the Forum
artwarlt: sometimes getting values like 2.100000000000001 or 2.599999999999999 instead of 2.1 and 2.6. Basically I'm expecting to get max only 2 decimal places after point. Even if I NormalizeDouble(Profit, 2); still get the same. Any ideas why it happens? |
|
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
Hello guys!
Need some help! When using script
Profit = OrderProfit() + OrderCommission();
Comment(Profit);
sometimes getting values like 2.100000000000001 or 2.599999999999999 instead of 2.1 and 2.6.
Basically I'm expecting to get max only 2 decimal places after point.
Even if I NormalizeDouble(Profit, 2); still get the same. Any ideas why it happens?
Thanks!