Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Fixed the bug with negative 0 displaying

Grant Sandersoneb149bef2ea5
diff --git a/topics/numerals.py b/topics/numerals.py
index a4437df40..f8ee064f9 100644
--- a/topics/numerals.py
+++ b/topics/numerals.py
@@ -15,6 +15,9 @@ class DecimalNumber(VMobject):
def __init__(self, number, **kwargs):
digest_config(self, kwargs, locals())
num_string = '%.*f'%(self.num_decimal_points, number)
+ negative_zero_string = "-%.*f"%(self.num_decimal_points, 0.)
+ if num_string == negative_zero_string:
+ num_string = num_string[1:]
VMobject.__init__(self, *[
TexMobject(char)
for char in num_string
@@ -27,7 +30,7 @@ class DecimalNumber(VMobject):
buff = self.digit_to_digit_buff,
aligned_edge = DOWN
)
- if number < 0:
+ if num_string.startswith("-"):
minus = self.submobjects[0]
minus.next_to(
self.submobjects[1], LEFT,