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 commitfe56249ad8
, reversing changes made to2f87972d80
. * Ensure rebuy_timeout Values are an integer Issue #42 Refactor and update another code block doing the same thing.
This commit is contained in:
parent
52a27c3467
commit
c664c41571
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue