code: def round_to_float(number, precision):
      
      rounded = Decimal(str(floor((number + precision / 2) // precision))
                        ) * Decimal(str(precision))
      return float(rounded)
docs: Round a float to a precision