nasihere / pyodbc

Automatically exported from code.google.com/p/pyodbc
MIT No Attribution
0 stars 0 forks source link

Microsoft Access currency column leads to corrupted Decimals for some values. #322

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Read $54871.00 from a Currency field in a Microsoft Access
2. Converted resulting decimal.Decimal to a float, and then printed.

What is the expected output? What do you see instead?

Expected a float: 56871.0
Got a weird corrupted value containing a colon: 54870.:

Reproducible for a small number of other values too.

What version of the product are you using? On what operating system?

pyodbc 3.0.6 (also reproduced on pypyodbc
python 1.7.4
Windows 7
Access 2010 (not reproducible on SQLServer)

Please provide any additional information below.

Described in more detail on StackOverflow:
http://stackoverflow.com/questions/16612301/python-inserts-a-colon-in-a-decimal-
number-from-access-via-pyodbc/

This includes more details of the steps taken, and an independent repro of the 
bug.

Original issue reported on code.google.com by h...@somethinkodd.com on 18 May 2013 at 6:53

GoogleCodeExporter commented 8 years ago
I was able to recreate this issue with pyodbc under Python 2.7.3 (Win, 32-bit). 
I have since upgraded Python to 2.7.5 (Win 32-bit), still running pyodbc 3.0.6, 
and the problem seems to have gone away.

Original comment by Gordon.D...@gmail.com on 26 May 2013 at 11:31