Ensure rebuy_timeout Values are an integer

Issue #42
This commit is contained in:
Nathaniel Nation 2019-02-21 16:00:35 -05:00
parent 8b3a683eb0
commit 2f87972d80
1 changed files with 3 additions and 1 deletions

View File

@ -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: