Small fix to DecimalNumber

This commit is contained in:
Grant Sanderson 2019-01-09 12:51:14 -08:00
parent 8e0fae4663
commit 2f6fc82ecb

View file

@ -26,8 +26,8 @@ class DecimalNumber(VMobject):
formatter = self.get_formatter()
num_string = formatter.format(number)
shows_zero = np.round(number, self.num_decimal_places) == 0
if num_string.startswith("-") and shows_zero:
rounded_num = np.round(float(number), self.num_decimal_places)
if num_string.startswith("-") and rounded_num == 0:
if self.include_sign:
num_string = "+" + num_string[1:]
else: