Hi Sandeep,
I don't think there's any trick to doing this, you just have to test and adjust the values yourself, something like;
app.alert(roundToNearestHalf(8.06));
app.alert(roundToNearestHalf(8.26));
app.alert(roundToNearestHalf(8.74));
app.alert(roundToNearestHalf(8.76));
function roundToNearestHalf(number)
{
var result = Math.floor(number);
var fraction = number - result;
if (fraction >= 0.75)
{
result++;
}
else
{
if (fraction > 0.25)
{
result += 0.5;
}
}
return result;
}
Regards
Bruce