# 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
            ["-0.0001", (1, 4)],
            [0.00001, (1, 5)],
            [-0.00001, (1, 5)],
            ["0.00001", (1, 5)],
            ["-0.00001", (1, 5)],
            [2e-05, (1, 5)],
            [-2e-05, (1, 5)],
            ["2e-05", (1, 5)],
            ["-2e-05", (1, 5)],
            ["0.000000000000001", (1, 15)],
            ["1e+15", (16, 0)],
        ],
    )
    def test_normal(self, value, expected):
        assert get_number_of_digit(value) == expected

    @pytest.mark.parametrize(
        ["value", "max_decimal_places", "expected"],
        [
            [0, 5, (1, 0)],
            ["0.000000000000001", 5, (1, 5)],
        ],
    )
    def test_normal_max_decimal_places(self, value, max_decimal_places, expected):
        assert get_number_of_digit(value, max_decimal_places=max_decimal_places) == expected

    @pytest.mark.parametrize(
        ["value"], [[None], [True], [inf], [nan], ["0xff"], ["test"], ["いろは".encode()]]
    )
    def test_nan(self, value):

# 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

            ["-0.0001", (1, 4)],
            [0.00001, (1, 5)],
            [-0.00001, (1, 5)],
            ["0.00001", (1, 5)],
            ["-0.00001", (1, 5)],
            [2e-05, (1, 5)],
            [-2e-05, (1, 5)],
            ["2e-05", (1, 5)],
            ["-2e-05", (1, 5)],
            ["0.000000000000001", (1, 15)],
            ["1e+15", (16, 0)],
        ],
    )
    def test_normal(self, value, expected):
        assert get_number_of_digit(value) == expected

    @pytest.mark.parametrize(
        ["value", "max_decimal_places", "expected"],
        [
            [0, 5, (1, 0)],
            ["0.000000000000001", 5, (1, 5)],
        ],
    )
    def test_normal_max_decimal_places(self, value, max_decimal_places, expected):
        assert get_number_of_digit(value, max_decimal_places=max_decimal_places) == expected

    @pytest.mark.parametrize(
        ["value"], [[None], [True], [inf], [nan], ["0xff"], ["test"], ["いろは".encode()]]
    )
    def test_nan(self, value):

        integer_digits, decimal_places = get_number_of_digit(value)