From 2f87972d80299031666381fb4234b573eedacb1a Mon Sep 17 00:00:00 2001 From: Nathaniel Nation Date: Thu, 21 Feb 2019 16:00:35 -0500 Subject: [PATCH] Ensure rebuy_timeout Values are an integer Issue #42 --- Core/ProfitTrailer/SettingsHandler.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Core/ProfitTrailer/SettingsHandler.cs b/Core/ProfitTrailer/SettingsHandler.cs index 9c7906c..08f3db7 100644 --- a/Core/ProfitTrailer/SettingsHandler.cs +++ b/Core/ProfitTrailer/SettingsHandler.cs @@ -281,7 +281,9 @@ namespace Core.ProfitTrailer double oldValue = SystemHelper.TextToDouble(oldValueString, 0, "en-US"); if (oldValue < 0) offsetValuePercent = offsetValuePercent * -1; double oldValueOffset = (oldValue * (offsetValuePercent / 100)); - newValueString = Math.Round((oldValue + oldValueOffset), 8).ToString(new System.Globalization.CultureInfo("en-US")); + //Round up any decimal value >= .5 + int newValueTempString = (int)(Math.Round((oldValue + oldValueOffset), MidpointRounding.AwayFromZero) + .5); + newValueString = newValueTempString.ToString(new System.Globalization.CultureInfo("en-US")); } break; default: