]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- fix quantize recipe, fixes #3322
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 12 Mar 2015 15:49:35 +0000 (11:49 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 12 Mar 2015 15:49:35 +0000 (11:49 -0400)
doc/build/core/types.rst

index e6d43aee0aef532a628215fbb58c4f6d2daf936b..32a97343c94b6f5475a31fd06b44dd5edb038417 100644 (file)
@@ -334,7 +334,7 @@ many decimal places.   Here's a recipe that rounds them down::
 
         def __init__(self, *arg, **kw):
             TypeDecorator.__init__(self, *arg, **kw)
-            self.quantize_int = -(self.impl.precision - self.impl.scale)
+            self.quantize_int = - self.impl.scale
             self.quantize = Decimal(10) ** self.quantize_int
 
         def process_bind_param(self, value, dialect):