diff --git a/csharp/App/SaliMax/src/Flow.cs b/csharp/App/SaliMax/src/Flow.cs index 388b709cc..ddebc25fb 100644 --- a/csharp/App/SaliMax/src/Flow.cs +++ b/csharp/App/SaliMax/src/Flow.cs @@ -14,7 +14,7 @@ public static class Flow public static TextBlock Horizontal(Unit amount, Int32 width = 10) { - var label = amount.ToString(); + var label = amount.ToStringRounded(); var arrowChar = amount.Value < 0 ? LeftArrowChar : RightArrowChar; var arrow = Enumerable.Repeat(arrowChar, width).Join(); @@ -26,7 +26,7 @@ public static class Flow [SuppressMessage("ReSharper", "CoVariantArrayConversion")] public static TextBlock Vertical(Unit amount, Int32 height = 4) { - var label = amount.ToString(); + var label = amount.ToStringRounded(); var arrowChar = amount.Value < 0 ? UpArrowChar : DownArrowChar; var halfArrow = Enumerable.Repeat(arrowChar, height/2); diff --git a/csharp/Lib/Units/Unit.cs b/csharp/Lib/Units/Unit.cs index e30787060..e007f7f66 100644 --- a/csharp/Lib/Units/Unit.cs +++ b/csharp/Lib/Units/Unit.cs @@ -8,4 +8,5 @@ public abstract class Unit public Double Value { get; } public override String ToString() => $"{Value} {Symbol}"; + public String ToStringRounded() => $"{Math.Round(Value,3)} {Symbol}"; } \ No newline at end of file