# Rounding Numbers

**URL:** <https://forum.kirupa.com/t/rounding-numbers/207617>\
**Category:** programming\
**Created:** [November 20, 2006, 1:55am UTC](https://forum.kirupa.com/t/rounding-numbers/207617 "2006-11-20T01:55:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Holmesc](https://avatars.discourse-cdn.com/v4/letter/h/9f8e36/32.png) [@Holmesc](https://forum.kirupa.com/u/Holmesc)\
**Post date:** [November 20, 2006, 1:55am UTC](https://forum.kirupa.com/t/rounding-numbers/207617/1 "2006-11-20T01:55:03Z")

</div>

Hello! I am currently working on a… flash thingy in which you click on the stage, and a blue square goes to where you have clicked. Then, a red square pathfinds it’s way to the blue square. The way I choose the blue squares’s \_x and \_y is as follows (with target\_square being the blue square):

```auto
onMouseDown = function() {
      _root.target_square._x = _root._xmouse;
      _root.target_square._y = _root._ymouse;
}

```

Pretty simple, as you can see. However, I would like to have the blue square’s \_x and \_y be multiples of 30! Is there a way to do this? Thanks!
