]> 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:48:47 +0000 (11:48 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 12 Mar 2015 15:50:00 +0000 (11:50 -0400)
doc/build/core/custom_types.rst

index 8d0c42703bc1074ac1ac9275c20dff38b281cc14..7fca1a537be3ed7b2659814bc5715bb1ebc60cb3 100644 (file)
@@ -108,7 +108,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):