Skip to content

scientific_to_readable

esta.aide.scientific_to_readable

Convert scientific notation in text to fixed decimal notation.

decimal_arg(s: str) -> Decimal

Parse command-line argument as Decimal (non-negative).

fixed_decimal_string(s: str) -> str

Convert scientific notation to fixed decimal string.

should_convert(s: str, fixed_min: Decimal = Decimal('1e-4'), fixed_max: Decimal = Decimal('1e6'), max_fixed_len: int = 12, max_leading_frac_zeros: int = 3) -> bool

Decide if we should convert to fixed notation.

convert_text(text: str, fixed_min: Decimal = Decimal('1e-4'), fixed_max: Decimal = Decimal('1e6'), max_fixed_len: int = 12, max_leading_frac_zeros: int = 3) -> str

Main conversion function.