Login Page - Create Account

Support Board


Date/Time: Sun, 12 May 2024 21:09:12 +0000



Post From: is there any ACSIL function that rounds

[2018-08-13 20:09:30]
User61576 - Posts: 418
using the following
lvl1OrderPrice = sc.RoundToTickSize((double)(sc.BaseDataIn[SC_LOW][cur - 1] + (lvl1Price.GetInt() * sc.TickSize)), 0.01);
gives me 69.070000000000007

and without (double) it's not compiling so it's working as a double...
also
lvl1OrderPrice = round(lvl1OrderPrice * 100) / 100;

I tried to work with long double and still got the same results. looks like the floating point keeps giving me the full double result.

I need to get 69.07