
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
but this value
0.099999999
will return 0.1
)
then what was quoted above would be more appropriate to the task of the TC:
Returns:
I sketched out a function that does exactly what I want it to do: precisely truncates a string to the specified precision , unlike DoubleToStr:
Result for "0.09864724":
Result for"0,-843158":
Operations with double and similar:
I've been searching through and such a function already exists in MQL4 (5?). If it's not there, why not add it a long time ago? :)
I sketched out a function that does exactly what I want it to do: precisely truncates a string to the specified precision , unlike DoubleToStr:
Result for "0.09864724":
Result for"0,-843158":
Operations with double and similar:
I've been searching through and such a function already exists in MQL4 (5?). If it's not there, why not add it a long time ago? :)
I sketched out a function that does exactly what I want it to do: precisely truncates a string to the specified precision , unlike DoubleToStr:
Result for "0.09864724":
Result for"0,-843158":
Operations with double and similar:
I've been searching through and such a function already exists in MQL4 (5?). If it's not there, why not add it a long time ago? :)
take this example:
how to leave =0.01999999999999999999 -- leave =0.01
You're operating with out-of-character examples -- so you can't conclude that your function works correctly.
take this example:
how to leave =0.01999999999999999999 -- leave =0.01
I still don't understand what you want.
If you want to see 0.098 on the chart instead of 0.098, then do so!
int a=0.098 * 100;
double d=a/100.0;
Comment(StringFormat("%G", d );
checked the last function, leaves 0.01
Checked your function -- leaves 0.02.
Indeed, 0.02.
My function may be more cumbersome, but it cuts off exactly 0.01.
checked the last function, leaves 0.01