Thinking » Tags » .net
While working on some custom tracking software, I ran into a very peculiar issue when storing some floating point values in a Microsoft SQL database. Specifically, I noticed I was getting weird rounding applied to my input. This only happened when there were more than two digits after the decimal point; for instance, 1.005 would become 1.004853184548342. The column in MS SQL was a float, and I was using a float before sending it through the ADO.Net pipeline.
The sample API code provided by PayPal has not been updated in some time. When it comes to recent versions of Microsoft’s .NET platform, not only is PayPal missing some DLLs needed to use it ‘out of the box’, the sample functions are actually wrong!
We discovered the problem while working on a custom built .NET web application for the Council of Public Relations Firms that includes integrated eCommerce. Thankfully, with some sleuthing and tinkering, we were able to update the necessary DLLs and correct the functions.