mirror of
https://github.com/3b1b/manim.git
synced 2025-04-13 09:47:07 +00:00
Fixed -0 issue with DecimalNumber
This commit is contained in:
parent
30f061ff01
commit
c3919d25ab
1 changed files with 2 additions and 5 deletions
|
@ -1,11 +1,7 @@
|
|||
|
||||
|
||||
from constants import *
|
||||
import operator as op
|
||||
|
||||
from mobject.svg.tex_mobject import SingleStringTexMobject
|
||||
from mobject.types.vectorized_mobject import VMobject
|
||||
from functools import reduce
|
||||
|
||||
|
||||
class 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(*[
|
||||
|
|
Loading…
Add table
Reference in a new issue