Repository: ManimCommunity/manim
File: manim/mobject/text/numbers.py (Python)

Code before:
from __future__ import annotations

__all__ = ["DecimalNumber", "Integer", "Variable"]

from typing import Sequence

import numpy as np

from manim import config
from manim.constants import *
from manim.mobject.opengl.opengl_compatibility import ConvertToOpenGL
from manim.mobject.text.tex_mobject import MathTex, SingleStringMathTex, Tex
from manim.mobject.text.text_mobject import Text
from manim.mobject.types.vectorized_mobject import VMobject
from manim.mobject.value_tracker import ValueTracker

string_to_mob_map = {}


class DecimalNumber(VMobject, metaclass=ConvertToOpenGL):
    """An mobject representing a decimal number.

    Parameters
    ----------
    number
        The numeric value to be displayed. It can later be modified using `.set_value()`.
    num_decimal_places
        The number of decimal places after the decimal separator. Values are automatically rounded.
    mob_class
        The class for rendering digits and units, by default `MathTex`.
    include_sign
        Set to `True` to include a sign for positive numbers and zero.
    group_with_commas
        When `True` thousands groups are separated by commas for readability.
    digit_buff_per_font_unit
        Additional spacing between digits. Scales with font size.
    show_ellipsis
        When a number has been truncated by rounding, indicate with an ellipsis (...).
    unit
        A unit string which can be placed to the right of the numerical values.
    unit_buff_per_font_unit
        An additional spacing between the numerical values and the unit. A value
        of `unit_buff_per_font_unit=0.003` gives a decent spacing. Scales with font size.
    include_background_rectangle
        Adds a background rectangle to increase contrast on busy scenes.
    edge_to_fix
        Assuring right- or left-alignment of the full object.
    font_size
        Size of the font

    Examples

Review comment (suggestion):
```suggestion
        The numeric value to be displayed. It can later be modified using :meth:`.set_value`.
```

Code after:
from __future__ import annotations

__all__ = ["DecimalNumber", "Integer", "Variable"]

from typing import Sequence

import numpy as np

from manim import config
from manim.constants import *
from manim.mobject.opengl.opengl_compatibility import ConvertToOpenGL
from manim.mobject.text.tex_mobject import MathTex, SingleStringMathTex, Tex
from manim.mobject.text.text_mobject import Text
from manim.mobject.types.vectorized_mobject import VMobject
from manim.mobject.value_tracker import ValueTracker

string_to_mob_map = {}


class DecimalNumber(VMobject, metaclass=ConvertToOpenGL):
    """An mobject representing a decimal number.

    Parameters
    ----------
    number
        The numeric value to be displayed. It can later be modified using :meth:`.set_value`.
    num_decimal_places
        The number of decimal places after the decimal separator. Values are automatically rounded.
    mob_class
        The class for rendering digits and units, by default :class:`.MathTex`.
    include_sign
        Set to ``True`` to include a sign for positive numbers and zero.
    group_with_commas
        When ``True`` thousands groups are separated by commas for readability.
    digit_buff_per_font_unit
        Additional spacing between digits. Scales with font size.
    show_ellipsis
        When a number has been truncated by rounding, indicate with an ellipsis (``...``).
    unit
        A unit string which can be placed to the right of the numerical values.
    unit_buff_per_font_unit
        An additional spacing between the numerical values and the unit. A value
        of ``unit_buff_per_font_unit=0.003`` gives a decent spacing. Scales with font size.
    include_background_rectangle
        Adds a background rectangle to increase contrast on busy scenes.
    edge_to_fix
        Assuring right- or left-alignment of the full object.
    font_size
        Size of the font.

    Examples