Use the function below, hope it helps
function roundByQuarter(value) { var inv = 1.0 / 0.25; return Math.round(value * inv) / inv; }
Calling the function as shown below will result in the closest Quarter value, i.e. it will not return .32, .89, .56, but will only return 0.25, .75, .50 decimal places.
roundByQuarter(2.74) = 2.75 roundByQuarter(2.34) = 2.25 roundByQuarter(2.94) = 3.00 roundByQuarter(2.24) = 2.25
Mahesh Yadav Mar 19 '17 at 11:19 on 2017-03-19 11:19
source share