mirror of
https://github.com/3b1b/manim.git
synced 2025-11-14 02:57:46 +00:00
Ensure exact integers are displays for large values in Integer
This commit is contained in:
parent
80fb1a98a9
commit
0d415036a9
1 changed files with 3 additions and 1 deletions
|
|
@ -98,6 +98,8 @@ class DecimalNumber(VMobject):
|
|||
formatter = self.get_complex_formatter()
|
||||
else:
|
||||
formatter = self.get_formatter()
|
||||
if self.num_decimal_places == 0 and isinstance(number, float):
|
||||
number = int(number)
|
||||
num_string = formatter.format(number)
|
||||
|
||||
rounded_num = np.round(number, self.num_decimal_places)
|
||||
|
|
@ -149,7 +151,7 @@ class DecimalNumber(VMobject):
|
|||
":",
|
||||
"+" if config["include_sign"] else "",
|
||||
"," if config["group_with_commas"] else "",
|
||||
f".{ndp}f",
|
||||
f".{ndp}f" if ndp > 0 else "d",
|
||||
"}",
|
||||
])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue