Ensure rebuy_timeout Values are an integer (#72)

* Update CODE_OF_CONDUCT.md

* Added Clearer Log Message

* Update _Development/README.md

Include the need for appsettings.json in the monitor folder

* Revert "Update _Development/README.md"

* Revert "Added Clearer Log Message"

* Ensure rebuy_timeout Values are an integer

Issue #42

* Revert "Merge remote-tracking branch 'PTMagicians/master' into develop"

This reverts commit fe56249ad8, reversing
changes made to 2f87972d80.

* Ensure rebuy_timeout Values are an integer

Issue #42

Refactor and update another code block doing the same thing.
This commit is contained in:
Nathaniel Nation 2019-02-21 17:14:38 -05:00 committed by JackTerok
parent 52a27c3467
commit c664c41571
1 changed files with 6 additions and 2 deletions

View File

@ -281,7 +281,9 @@ namespace Core.ProfitTrailer
double oldValue = SystemHelper.TextToDouble(oldValueString, 0, "en-US"); double oldValue = SystemHelper.TextToDouble(oldValueString, 0, "en-US");
if (oldValue < 0) offsetValuePercent = offsetValuePercent * -1; if (oldValue < 0) offsetValuePercent = offsetValuePercent * -1;
double oldValueOffset = (oldValue * (offsetValuePercent / 100)); 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 newTempValue = (int)(Math.Round((oldValue + oldValueOffset), MidpointRounding.AwayFromZero) + .5);
newValueString = newTempValue.ToString(new System.Globalization.CultureInfo("en-US"));
} }
break; break;
default: default:
@ -537,7 +539,9 @@ namespace Core.ProfitTrailer
double oldValue = SystemHelper.TextToDouble(SettingsHandler.GetCurrentPropertyValue(fullProperties, propertyKey, propertyKey.Replace("ALL_", "DEFAULT_")), 0, "en-US"); double oldValue = SystemHelper.TextToDouble(SettingsHandler.GetCurrentPropertyValue(fullProperties, propertyKey, propertyKey.Replace("ALL_", "DEFAULT_")), 0, "en-US");
if (oldValue < 0) offsetValuePercent = offsetValuePercent * -1; if (oldValue < 0) offsetValuePercent = offsetValuePercent * -1;
double oldValueOffset = (oldValue * (offsetValuePercent / 100)); 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 newTempValue = (int)(Math.Round((oldValue + oldValueOffset), MidpointRounding.AwayFromZero) + .5);
newValueString = newTempValue.ToString(new System.Globalization.CultureInfo("en-US"));
} }
break; break;
default: default: