# Rounding off to nearest 0.5

**URL:** <https://forum.kirupa.com/t/rounding-off-to-nearest-0-5/165067>\
**Category:** flash\
**Created:** [October 7, 2005, 9:45am UTC](https://forum.kirupa.com/t/rounding-off-to-nearest-0-5/165067 "2005-10-07T09:45:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![thybalt](https://avatars.discourse-cdn.com/v4/letter/t/e5b9ba/32.png) [@thybalt](https://forum.kirupa.com/u/thybalt)\
**Post date:** [October 7, 2005, 9:45am UTC](https://forum.kirupa.com/t/rounding-off-to-nearest-0-5/165067/1 "2005-10-07T09:45:14Z")

</div>

Hello guys

I need to do this ONE tiny bit before my app is complete.

Math.round lets me round off to the nearest integer, but now I really need to round off to the nearest 0.5 or whole number.

ie.

10.488889 ~ 10.5  
16.9999555 ~ 17  
4.9999999 ~ 5  
11. 51111111 ~ 11.5

Yep the values are somewhat like those. It’s really really close to the 0.5 or whole values. I’ve been racking my brains for the past 2 hrs and I really can’t figure it out.

Will appreciated any help. Thanks a lot!!!
