# Decimals screwup?

**URL:** <https://forum.kirupa.com/t/decimals-screwup/170389>\
**Category:** Uncategorized\
**Created:** [November 25, 2005, 10:30am UTC](https://forum.kirupa.com/t/decimals-screwup/170389 "2005-11-25T10:30:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mirandir](https://avatars.discourse-cdn.com/v4/letter/m/a5b964/32.png) [@Mirandir](https://forum.kirupa.com/u/Mirandir)\
**Post date:** [November 25, 2005, 10:30am UTC](https://forum.kirupa.com/t/decimals-screwup/170389/1 "2005-11-25T10:30:00Z")

</div>

Oki. I’ve found something I haven’t noticed before but it seems like sometimes Flash totally screws up the decimals when assigning calculated numbers with decimals to the movieclips position properties. Well at least it goeas for the \_y property.

Amongst others I got this function that moves the movieclip about:

```auto

function setAnimState(current:Object, changes:Object)
{
this._x = current._x;
trace("before:" + this._y)
trace("current:" + current._y);
trace("changes:" + changes._y);
this._y = current._y;
trace("after:" + this._y)
}

```

Now theese traces reaveals something quite interesting.

Here take a look at one of the traces:

before:100  
current:100.081721378015  
changes:0.0817213780150468  
after:100.05

Notice the value “after”? It’s **100.05** (!!) but it should at least be **100.08** or rounded to **100.1**. Nowhere near **100.05**. Oki I’m not a mathwizard but I do know as much as that the rounding is way of base.

If I hardcode the current.\_y value (100.081721378015) i get **100.1** as the position of the movieclip.

So my question is: How can Flash round my calculated values so incorrect? Is there some inner workings on the positioning of movieclips that I should know about? And, most importantly, what do I do to fix it?

/Mirandir
