def _calculate_precision(value: str) -> int:
    """Calculate the precision of given value as a string."""
    no_decimal_point = value.replace(".", "")
    no_leading_or_trailing_zeros = no_decimal_point.strip("0")
    return len(no_leading_or_trailing_zeros)