Skip to content

Commit

Permalink
Added special converter from float to correct float number
Browse files Browse the repository at this point in the history
  • Loading branch information
TTLC198 committed Dec 7, 2023
1 parent 5b088ae commit da731a6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions HSMonitor/Utils/NumberExtensions.cs
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit da731a6

Please sign in to comment.