# Path: dataproperty/_function.py
# def get_integer_digit(value) -> int:
#     float_type = RealNumber(value)
# 
#     try:
#         abs_value = abs(float_type.convert())
#     except TypeConversionError:
#         try:
#             abs_value = abs(Integer(value).convert())
#         except TypeConversionError:
#             raise ValueError(f"the value must be a number: value='{value}' type='{type(value)}'")
# 
#         return len(str(abs_value))
# 
#     if abs_value.is_zero():
#         return 1
# 
#     try:
#         return len(str(abs_value.quantize(Decimal("1."), rounding=decimal.ROUND_DOWN)))
#     except decimal.InvalidOperation:
#         return len(str(abs_value))
# 
# def get_number_of_digit(
#     value: Any, max_decimal_places: int = 99
# ) -> Tuple[Optional[int], Optional[int]]:
#     try:
#         integer_digits = get_integer_digit(value)
#     except (ValueError, TypeError, OverflowError):
#         return (None, None)
# 
#     try:
#         decimal_places: Optional[int] = min(
#             _digit_calculator.get_decimal_places(value), max_decimal_places
#         )
#     except (ValueError, TypeError):
#         decimal_places = None
# 
#     return (integer_digits, decimal_places)


import pytest
from dataproperty import get_integer_digit, get_number_of_digit
    def test_normal(self, value, expected):
        assert get_integer_digit(value) == expected

    @pytest.mark.parametrize(
        ["value", "expected"],
        [
            [999999999999999999999999999999.9999999999, 31],
            [-999999999999999999999999999999.9999999999, 31],
            ["999999999999999999999999999999.9999999999", 30],
            ["-999999999999999999999999999999.9999999999", 30],
        ],
    )
    def test_abnormal(self, value, expected):
        assert get_integer_digit(value) == expected

    @pytest.mark.parametrize(
        ["value", "exception"],
        [
            [True, ValueError],
            [False, ValueError],
            [None, ValueError],
            ["test", ValueError],
            ["a", ValueError],
            ["0xff", ValueError],
            [nan, ValueError],
            [inf, ValueError],
        ],
    )
    def test_exception(self, value, exception):
        with pytest.raises(exception):

# Path: dataproperty/_function.py
# def get_integer_digit(value) -> int:
#     float_type = RealNumber(value)
# 
#     try:
#         abs_value = abs(float_type.convert())
#     except TypeConversionError:
#         try:
#             abs_value = abs(Integer(value).convert())
#         except TypeConversionError:
#             raise ValueError(f"the value must be a number: value='{value}' type='{type(value)}'")
# 
#         return len(str(abs_value))
# 
#     if abs_value.is_zero():
#         return 1
# 
#     try:
#         return len(str(abs_value.quantize(Decimal("1."), rounding=decimal.ROUND_DOWN)))
#     except decimal.InvalidOperation:
#         return len(str(abs_value))
# 
# def get_number_of_digit(
#     value: Any, max_decimal_places: int = 99
# ) -> Tuple[Optional[int], Optional[int]]:
#     try:
#         integer_digits = get_integer_digit(value)
#     except (ValueError, TypeError, OverflowError):
#         return (None, None)
# 
#     try:
#         decimal_places: Optional[int] = min(
#             _digit_calculator.get_decimal_places(value), max_decimal_places
#         )
#     except (ValueError, TypeError):
#         decimal_places = None
# 
#     return (integer_digits, decimal_places)


# Path: test/test_function.py
import pytest
from dataproperty import get_integer_digit, get_number_of_digit

    def test_normal(self, value, expected):
        assert get_integer_digit(value) == expected

    @pytest.mark.parametrize(
        ["value", "expected"],
        [
            [999999999999999999999999999999.9999999999, 31],
            [-999999999999999999999999999999.9999999999, 31],
            ["999999999999999999999999999999.9999999999", 30],
            ["-999999999999999999999999999999.9999999999", 30],
        ],
    )
    def test_abnormal(self, value, expected):
        assert get_integer_digit(value) == expected

    @pytest.mark.parametrize(
        ["value", "exception"],
        [
            [True, ValueError],
            [False, ValueError],
            [None, ValueError],
            ["test", ValueError],
            ["a", ValueError],
            ["0xff", ValueError],
            [nan, ValueError],
            [inf, ValueError],
        ],
    )
    def test_exception(self, value, exception):
        with pytest.raises(exception):

            get_integer_digit(value)