[ 
https://issues.apache.org/jira/browse/AVRO-4161?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Tzvetanov Grigorov resolved AVRO-4161.
---------------------------------------------
    Fix Version/s: 1.13.0
       Resolution: Fixed

> C# decimal conversions are not correct
> --------------------------------------
>
>                 Key: AVRO-4161
>                 URL: https://issues.apache.org/jira/browse/AVRO-4161
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: csharp
>    Affects Versions: 1.12.0
>            Reporter: Robert Yokota
>            Assignee: Robert Yokota
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.13.0
>
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> The conversion from the C# System.Decimal to an Avro logical type decimal is 
> not correct.  The first 12 bytes of the System.Decimal represent a positive 
> unscaled value.  This value is passed into a BigInteger constructor.  
> However, the documentation of the [BigInteger constructor| 
> https://learn.microsoft.com/en-us/dotnet/api/system.numerics.biginteger.-ctor?view=net-9.0#system-numerics-biginteger-ctor(system-byte())]
>  states that the most significant bit of the last byte represents the sign of 
> the BigInteger.  The docs also explain that a 0 byte can be appended to the 
> byte array passed to the BigInteger constructor to ensure the value is 
> treated as positive.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to