def bin_mapping(value_to_classify, nr_of_classes, class_bins,
    placeholder_zero_color):
    """Maps values to a bin.
    The mapped values must start at 0 and end at 1.

    Arguments
    ---------
    value_to_classify : float
        Value to classify
    class_bins : list
        Bins to use for classification

    Returns
    -------
    classified value
    """
    round_digits = 4
    value_to_classify = round(value_to_classify, round_digits)
    if value_to_classify == 0 or value_to_classify == -0:
        """for idx, bound in enumerate(class_bins):
            if value_to_classify == bound:
                return idx / (len(class_bins) - 1.0)"""
        return placeholder_zero_color
    for idx, bound in enumerate(class_bins):
        if value_to_classify < bound:
            return idx / (nr_of_classes - 1.0)
