[Sqlalchemy-tickets] Issue #3322: SafeNumeric TypeDecorator recipe on documentation: wrong semantic
Brought to you by:
zzzeek
|
From: Eduardo D. <iss...@bi...> - 2015-03-12 15:41:58
|
New issue 3322: SafeNumeric TypeDecorator recipe on documentation: wrong semantics https://bitbucket.org/zzzeek/sqlalchemy/issue/3322/safenumeric-typedecorator-recipe-on Eduardo Dobay: When rounding a Decimal to fit in a database column, the number of digits that must remain following the decimal point should be the **scale** — please correct me if I am interpreting this incorrectly; I'm using the terminology from MySQL docs. According to this understanding, in the SafeNumeric TypeDecorator recipe in the Custom Types section of the documentation, the values are being rounded using `precision - scale` digits, which is actually the number of digits *before* the decimal point. So that should be replaced by just `scale`. |