A community-maintained Python framework for creating mathematical animations.
Fixed -0 issue with DecimalNumber
Grant Sandersonc3919d25abbd
diff --git a/mobject/numbers.py b/mobject/numbers.pyindex 63703ee97..e1e65d576 100644--- a/mobject/numbers.py+++ b/mobject/numbers.py@@ -1,11 +1,7 @@--from constants import *-import operator as opfrom mobject.svg.tex_mobject import SingleStringTexMobjectfrom mobject.types.vectorized_mobject import VMobject-from functools import reduceclass DecimalNumber(VMobject):@@ -30,7 +26,8 @@ class DecimalNumber(VMobject):formatter = self.get_formatter()num_string = formatter.format(number)- if num_string.startswith("-") and number == 0:+ shows_zero = np.round(number, self.num_decimal_places) == 0+ if num_string.startswith("-") and shows_zero:num_string = num_string[1:]self.add(*[