diff --git a/HSMonitor/Utils/NumberExtensions.cs b/HSMonitor/Utils/NumberExtensions.cs new file mode 100644 index 0000000..6dad539 --- /dev/null +++ b/HSMonitor/Utils/NumberExtensions.cs @@ -0,0 +1,7 @@ +namespace HSMonitor.Utils; + +public static class NumberExtensions +{ + public static float GetFloatAsCorrectNumber(this float? value) + => float.IsNaN(value ?? 0) ? 0 : value ?? 0; +} \ No newline at end of file