google-code-export / ibm-db

Automatically exported from code.google.com/p/ibm-db
1 stars 0 forks source link

ibm_db_sa: decfloat support #148

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
At time of writing, there is no field mapping in ibm_db_sa for the DB2 DECFLOAT 
type, so they just come back as strings.  decimal.Decimal is the appropriate 
python-side type to map them to, as discussed - 
https://groups.google.com/d/msg/ibm_db/mjjocQ-rHEw/OWv3h3zLZI4J

Original issue reported on code.google.com by dgol...@squaredfinancial.com on 14 Mar 2014 at 2:53

GoogleCodeExporter commented 9 years ago
(wonder if it would be possible and a good idea to actually warn if 
decimal.getcontext().prec <34 too, it defaults to 28 but can be raised. It's 
only relevant if python-side arithmetic is then performed I suppose, a created 
Decimal may have more precision than the current context prec, so maybe a 
mention of that issue in the documentation would be sufficient, or even 
unnecessary since it's just how python decimal is and one might expect a dev to 
know that...)

Original comment by dgol...@squaredfinancial.com on 14 Mar 2014 at 2:54