Title: AS3: Rounding values in Tweener class (Tweenlite)
Tags: actionscript-3;gsap
Question: I have a little issue, I'm rotating an object. I want rounded values for rotating the object for efficiency.
TweenLite.to(this, 1, { rotation:rotation+100 });
//Output rotation values
//83.02559999999998, 85.55999999999999, 88.02839999999999, 90.1404, 92.16, 93.8496
so I tried this
TweenLite.to(this, 1, { rotation:rotation+100, onUpdate:function()
rotation = Math.round(rotation);
But to no avail. Any ideas ?
Comment: @MarkKnol In general programming, floating points demands more processing than integers. Especially undue floating points causes processor to do extra work than normal. Of course limited use is unnoticeable. Extreme example of floating point which drives the CPU mad is PI calculation.

Comment: Are rounded rotation values really more efficient?

Comment: I think this only gives extra overhead instead of optimization, since you calculations did not change, you only alter the output. Since there is missing info why you want to use this, I think you should not optimize in this way.
By the way, TweenMax has a build-in feature for faster rendering of rotation, using the TranformMatrixPlugin, see https://www.greensock.com/tweening-tips/

Here is the accepted answer: You can try to use proxy object, such as
var obj:Object = {};
obj.rotation = this.rotation;
TweenLite.to(obj, 1, { rotation:rotation+100, onUpdate:function()
if (this.rotation != Math.round(obj.rotation))
this.rotation = Math.round(obj.rotation);

Here is another answer: If rendering is a problem; TweenMax has a build-in feature for faster rendering of rotation, using the TransformMatrixPlugin, see http://greensock.com/tweening-tips

Here is another answer: How about
TweenLite.to(this, 1, { rotation:Math.round(rotation+100) });

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 3, 'CommentCount': 3, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2012:00:11/20/12', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<actionscript-3><gsap>', 'Title': 'AS3: Rounding values in Tweener class (Tweenlite)', 'ViewCount': 371, 'id': 13469831, 'user_AboutMe': "<p>I've been in web design, javascripting, photoshopping. I've also been involved in solo game development venture for smartphones. </p>\n\n<p>I'd like people having ideas or anything about smartphone game development to get in touch with me.</p>\n\n<p>Right now i'm into Android App Development in full swing.</p>\n", 'user_AccountId': 1499199.0, 'user_DisplayName': 'Muhammad', 'user_Reputation': 425.0, 'user_Views': 139.0, 'user_id': 1404403.0}}