diff --git a/SabreTools.Helper/Logger.cs b/SabreTools.Helper/Logger.cs index 4d1e702a..fc42e768 100644 --- a/SabreTools.Helper/Logger.cs +++ b/SabreTools.Helper/Logger.cs @@ -242,7 +242,10 @@ namespace SabreTools.Helper { for (int i = line; i < Console.WindowHeight; i++) { - Log(" ", i, 0); + // http://stackoverflow.com/questions/8946808/can-console-clear-be-used-to-only-clear-a-line-instead-of-whole-console + Console.SetCursorPosition(0, Console.CursorTop); + Console.Write(new string(' ', Console.WindowWidth)); + Console.SetCursorPosition(0, i); } } return true; diff --git a/SimpleSort/SimpleSort.cs b/SimpleSort/SimpleSort.cs index a1319c03..c1e8ab81 100644 --- a/SimpleSort/SimpleSort.cs +++ b/SimpleSort/SimpleSort.cs @@ -360,7 +360,7 @@ namespace SabreTools bool success = true; // Get the full path of the input for movement purposes - string percentage = Math.Round((100 * ((double)index / total)), 2, MidpointRounding.AwayFromZero).ToString(); + string percentage = (index == 0 ? "0.00" : Math.Round((100 * ((double)index / total)), 2, MidpointRounding.AwayFromZero).ToString()); string statement = percentage + "% - " + input; _logger.ClearBeneath(_cursorTop + 1); _logger.Log(statement, _cursorTop, 0);