diff --git a/AUTHORS b/AUTHORS index 12475c2e..1d724718 100644 --- a/AUTHORS +++ b/AUTHORS @@ -242,3 +242,4 @@ that much better: * xiaost7 (https://github.com/xiaost7) * Victor Varvaryuk * Stanislav Kaledin (https://github.com/sallyruthstruik) + * Dmitry Yantsen (https://github.com/mrTable) diff --git a/docs/changelog.rst b/docs/changelog.rst index ad710bb1..61ea45c4 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -7,6 +7,7 @@ Changes in 0.10.8 - Added ability to specify an authentication mechanism (e.g. X.509) #1333 - Added support for falsey primary keys (e.g. doc.pk = 0) #1354 - Fixed BaseQuerySet#sum/average for fields w/ explicit db_field #1417 +- Fixed absent rounding for DecimalField when `force_string` is set. #1103 Changes in 0.10.7 ================= diff --git a/mongoengine/fields.py b/mongoengine/fields.py index 783aac46..2ad921d5 100644 --- a/mongoengine/fields.py +++ b/mongoengine/fields.py @@ -341,7 +341,7 @@ class DecimalField(BaseField): if value is None: return value if self.force_string: - return unicode(value) + return unicode(self.to_python(value)) return float(self.to_python(value)) def validate(self, value):