Fix Modifier ValueStr
This commit is contained in:
@ -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 => "+",
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user