use ToDisplayString() for ToString() as well

This commit is contained in:
ig 2023-08-25 17:12:20 +02:00
parent f8b1d70f79
commit 418bac6a6a
1 changed files with 2 additions and 1 deletions

View File

@ -7,7 +7,8 @@ public abstract class Unit
public abstract String Symbol { get; } public abstract String Symbol { get; }
public Double Value { get; } public Double Value { get; }
public override String ToString() => $"{Value} {Symbol}"; //public override String ToString() => $"{Value} {Symbol}";
public override String ToString() => ToDisplayString();
private static readonly IReadOnlyList<String> Prefix = new[] { "y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Y" }; private static readonly IReadOnlyList<String> Prefix = new[] { "y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Y" };