From 2e88d724a467891a13fdecaaa9bdd93833ab0f22 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Tue, 14 Nov 2023 20:12:25 +1300 Subject: [PATCH] mention and link to the package --- _posts/2023/2023-11-09-decimals-are-weird.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_posts/2023/2023-11-09-decimals-are-weird.md b/_posts/2023/2023-11-09-decimals-are-weird.md index 235c701..1b02612 100644 --- a/_posts/2023/2023-11-09-decimals-are-weird.md +++ b/_posts/2023/2023-11-09-decimals-are-weird.md @@ -51,7 +51,7 @@ When getting numbers from JSON throughout all of my libraries, I chose to use `d where each of the numbers are represented as `JsonNode`s with `decimals` underneath. -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. +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_. ## What's wrong with the extension? @@ -76,6 +76,6 @@ And it worked... until I tried the expression above. For **18 months** it's wor 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). -There's a new package available for those impacted by this (I didn't receive any reports). +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). 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.