From 941976a722a170496895faa1385f79786beef0ca Mon Sep 17 00:00:00 2001 From: Alecio Furanze Date: Sat, 4 May 2024 23:04:17 +0200 Subject: [PATCH] try fix by.add decimal --- src/by/By.Add.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/by/By.Add.cs b/src/by/By.Add.cs index 65f146f..4a31669 100644 --- a/src/by/By.Add.cs +++ b/src/by/By.Add.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Numerics; using System.Text; @@ -108,8 +109,7 @@ public void Add(T value) } case Types.Decimal: { - // TODO: create own implementation to be 100% precise - buffer.AddRange(BitConverter.GetBytes(Decimal.ToOACurrency((decimal)data))); + Decimal.GetBits((decimal)data).ToList().ForEach(x => buffer.AddRange(BitConverter.GetBytes(x))); break; } case Types.DateTime: