zhikrullah / pyshp

Automatically exported from code.google.com/p/pyshp
MIT License
0 stars 0 forks source link

Imprecise numeric type conversion #51

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
When a field is of type "N" (for numeric) and has a decimal length specified, 
the values in that field are converted to floats in Reader.__record().

This can sometimes result in a loss of precision, since not all decimal values 
can be represented accurately as a floating point number.

I believe this subtle data loss is an undesirable feature of the pyshp API. 
Therefore, I propose that the value be converted to either a string or a 
decimal type.

Original issue reported on code.google.com by m...@pdx.edu on 28 Jun 2013 at 8:24

GoogleCodeExporter commented 8 years ago
Good catch.   I'll try to return a decimal type otherwise return a string. 

Original comment by jlawh...@gmail.com on 28 Jun 2013 at 8:35