# Math.round question

**URL:** https://forum.kirupa.com/t/math-round-question/148513
**Category:** Uncategorized
**Created:** [May 20, 2005, 2:54pm UTC](https://forum.kirupa.com/t/math-round-question/148513 "2005-05-20T14:54:07Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![onsitus](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/onsitus/32/971_2.png) [@onsitus](https://forum.kirupa.com/u/onsitus)
#### Post date: [May 20, 2005, 2:54pm UTC](https://forum.kirupa.com/t/math-round-question/148513/1 "2005-05-20T14:54:07Z")

</div>

I’m using this code on an empty container which loads content from an external swf. I added the Math.round so that when the container slides the pixel font stays clear.

```auto
onClipEvent (load) {
Xpos = 170;
}
onClipEvent (enterFrame) {
Xa = _root.container1._x;
Xdiff = Xpos-Xa;
Xmove = Xdiff/7;
_root.container1._x = Math.round(Xa+Xmove);
}

```

The problem is that now the slide stops or too early or too late of a pixel, enough for not aligning with the rest of the elements on the page.  
Is there a way that if Xa+Xmove = 17.2 it goes 17 (normal Math.round)and instead if Xa+Xmove = 17.8 it goes 18?  
:flower:
