Question : round to the nearest 0.5
Answered by : osaka
def custom_round(x, base=0.5): return base * round(float(x)/base)
# you can replace the base parameter with the nearest rounding you need
Source : https://stackoverflow.com/questions/40372030/pandas-round-to-the-nearest-n | Last Update : Mon, 04 Apr 22
Question : round up to nearest 10
Answered by : disgusted-duck-qcmgtn7nwuot
Math.ceil(N / 10) * 10;
Source : https://stackoverflow.com/questions/11022488/javascript-using-round-to-the-nearest-10/11022517 | Last Update : Sat, 29 Jan 22