def roundPartial(value, resolution):
    return round(value / resolution) * resolution
print('Rounding to quarters')
print(roundPartial(10.38, 0.25))
print(roundPartial(11.12, 0.25))
print(roundPartial(5.24, 0.25))
print(roundPartial(9.76, 0.25))
print('Rounding to tenths')
print(roundPartial(9.74, 0.1))
print(roundPartial(9.75, 0.1))
print(roundPartial(9.76, 0.1))
print('Rounding to hundreds')
print(roundPartial(987654321, 100))
Python – округление по квартальным интервалам