Skip to content

Commit 2e88d72

Browse files
committed
mention and link to the package
1 parent 03e83a4 commit 2e88d72

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_posts/2023/2023-11-09-decimals-are-weird.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ When getting numbers from JSON throughout all of my libraries, I chose to use `d
5151

5252
where each of the numbers are represented as `JsonNode`s with `decimals` underneath.
5353

54-
When the system processes `3.2 + 0.8`, it gives me `4.0`. As I said before, numeric comparisons between `decimal`s work fine. But in these expressions, `==` doesn't compare just numbers; it compares `JsonNode`s. And it does so using my `.IsEquivalentTo()` extension method.
54+
When the system processes `3.2 + 0.8`, it gives me `4.0`. As I said before, numeric comparisons between `decimal`s work fine. But in these expressions, `==` doesn't compare just numbers; it compares `JsonNode`s. And it does so using my `.IsEquivalentTo()` extension method, found in _Json.More.Net_.
5555

5656
## What's wrong with the extension?
5757

@@ -76,6 +76,6 @@ And it worked... until I tried the expression above. For **18 months** it's wor
7676

7777
So now I check explicitly for numeric equality by calling `.GetNumber()`, which checks all of the various .Net number types returns a `decimal?` (null if it's not a number).
7878

79-
There's a new package available for those impacted by this (I didn't receive any reports).
79+
There's a new [_Json.More.Net_](https://www.nuget.org/packages/Json.More.Net/) package available for those impacted by this (I didn't receive any reports).
8080

8181
And that's the story of how creating a new package to support a new JSON functionality showed me how 4 is not always 4.

0 commit comments

Comments
 (0)