Fix Modifier ValueStr

This commit is contained in:
2023-08-19 17:08:38 +02:00
parent 8f7d699b4e
commit 5093706a4a
2 changed files with 12 additions and 2 deletions

View File

@ -9,6 +9,7 @@ using System.IO.Ports;
using System.Net.Sockets;
using Elwig.Dialogs;
using System.Text;
using System.Numerics;
namespace Elwig.Helpers {
public static partial class Utils {
@ -234,5 +235,12 @@ namespace Elwig.Helpers {
return Text;
}
}
public static string GetSign<T>(T number) where T : INumber<T>
=> T.Sign(number) switch {
< 0 => "\u2212", // minus
0 => "\u00b1", // plus minus
> 0 => "+",
};
}
}