# Path: typepy/_common.py
# def strip_ansi_escape(value: Any) -> str:
#     return ansi_escape.sub("", value)
# 
# Path: typepy/_const.py
# class DefaultValue:
#     FLOAT_TYPE = Decimal
#     STRIP_ANSI_ESCAPE = True
# 
# class ParamKey:
#     STRIP_ANSI_ESCAPE = "strip_ansi_escape"
#     TIMEZONE = "timezone"
# 
# Path: typepy/error.py
# class TypeConversionError(TypeError):
#     """
#     Exception raised when failed to convert data.
#     """
# 
# Path: typepy/converter/_interface.py
# class AbstractValueConverter(ValueConverterInterface):
#     __slots__ = "_value"
# 
#     def __init__(self, value, params):
#         self._value = value
#         self._params = params
# 
#     def __repr__(self):
#         try:
#             string = str(self.force_convert())
#         except TypeConversionError:
#             string = "[ValueConverter ERROR] failed to force_convert"
# 
#         return string


import decimal
from .._common import strip_ansi_escape
from .._const import DefaultValue, ParamKey
from ..error import TypeConversionError
from ._interface import AbstractValueConverter
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""




class FloatConverter(AbstractValueConverter):
    def __init__(self, value, params):
        super().__init__(value, params)

        self.float_class = self._params.get("float_type")
        if self.float_class is None:

# Path: typepy/_common.py
# def strip_ansi_escape(value: Any) -> str:
#     return ansi_escape.sub("", value)
# 
# Path: typepy/_const.py
# class DefaultValue:
#     FLOAT_TYPE = Decimal
#     STRIP_ANSI_ESCAPE = True
# 
# class ParamKey:
#     STRIP_ANSI_ESCAPE = "strip_ansi_escape"
#     TIMEZONE = "timezone"
# 
# Path: typepy/error.py
# class TypeConversionError(TypeError):
#     """
#     Exception raised when failed to convert data.
#     """
# 
# Path: typepy/converter/_interface.py
# class AbstractValueConverter(ValueConverterInterface):
#     __slots__ = "_value"
# 
#     def __init__(self, value, params):
#         self._value = value
#         self._params = params
# 
#     def __repr__(self):
#         try:
#             string = str(self.force_convert())
#         except TypeConversionError:
#             string = "[ValueConverter ERROR] failed to force_convert"
# 
#         return string


# Path: typepy/converter/_realnumber.py
import decimal
from .._common import strip_ansi_escape
from .._const import DefaultValue, ParamKey
from ..error import TypeConversionError
from ._interface import AbstractValueConverter

"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""




class FloatConverter(AbstractValueConverter):
    def __init__(self, value, params):
        super().__init__(value, params)

        self.float_class = self._params.get("float_type")
        if self.float_class is None:

            self.float_class = DefaultValue.FLOAT_TYPE