# HG changeset patch # User Daniele Nicolodi # Date 1414429352 -3600 # Node ID 9e240adb3053276652868950a2e2526c41b0b26c # Parent 28a56e4c06a431cb421240a0722e3207d7f1af01 Fix N estimate to properly round diff -r 28a56e4c06a4 -r 9e240adb3053 FXAnalyse.c --- a/FXAnalyse.c Mon Oct 27 17:48:22 2014 +0100 +++ b/FXAnalyse.c Mon Oct 27 18:02:32 2014 +0100 @@ -56,7 +56,7 @@ double Math1, Math2, Math3, Math4, Math5; double N1, N2, N3; double Ndiv = 8.0; -double Sign1 = 1.0, Sign2 = 1.0, Sign3 = 0.0; +double Sign1 = 1, Sign2 = 1, Sign3 = 1; void *MathParser1, *MathParser2, *MathParser3, *MathParser4, *MathParser5; @@ -2284,6 +2284,7 @@ void *callbackData, int eventData1, int eventData2) { void *v; + double n; int estimate = 0; switch (event) @@ -2293,11 +2294,13 @@ estimate = PTR_TO_INT(v); switch (estimate) { case HG: - GetCtrlVal(panel, ESTIMATEN_N, &N2); + GetCtrlVal(panel, ESTIMATEN_N, &n); + N2 = round(n); SetCtrlVal(MainPanel, PANEL_N2, N2); break; case SR: - GetCtrlVal(panel, ESTIMATEN_N, &N3); + GetCtrlVal(panel, ESTIMATEN_N, &n); + N3 = round(n); SetCtrlVal(MainPanel, PANEL_N3, N3); break; }