import math


def truncate(value: float, decimal_places: int):
    """Truncates a value to a number of decimals places"""
    return math.trunc(value * (10 ** decimal_places)) / (10 ** decimal_places)