import random


def random_float(min=1.0, max=100.0, decimals=None):
    """Generate a random float between min and max.

    `decimals` is the maximum amount of decimal places
    the generated float should have.
    """
    randomfloat = random.uniform(min, max)
    if decimals is not None:
        randomfloat = round(randomfloat, decimals)
    return randomfloat