import math


def quantizeValue(value, *, per_decade=12):
    """Quantize to nearest mathematical E12 value or any other series."""

    if value <= 0.0:
        return value
    q_step = math.log(value, 10) * per_decade
    q_value = 10 ** (round(q_step) / per_decade)
    return q_value