Home Tutorials Forums Articles Blogs Movies Library Employment Press

 ActionScript.org Forums Rounding numbers with decimals
 Register FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

 10-28-2003, 11:06 AM #1 mrand01 Senior Member   Join Date: Jun 2003 Location: Morris Plains, NJ Posts: 621 Rounding numbers with decimals how would I go about rounding a number with 3 decimals to just 1 decimal. ex: 1.169 = 1.2 I know they have Math.Ceil, etc., but thats for integers, not floating point numbers...
 10-28-2003, 11:11 AM #2 annexion I make out with chicks   Join Date: Oct 2002 Location: NYC Posts: 1,586 ActionScript Code: ```numVar=3.141592654; rounded=Math.round(numvar*10)/10;``` Essentially you're multiplying it by ten so you get the one decimal place over to be able to round it, then you're dividing by ten to get the decimal place back. Hope that helps, good luck. __________________ www.perpetuated.com
 10-28-2003, 11:15 AM #3 mrand01 Senior Member   Join Date: Jun 2003 Location: Morris Plains, NJ Posts: 621 hmm, i thought of that, just kinda figured there would be a built in function, guess not...thanks
 10-28-2003, 11:33 AM #4 senocular six eyes     Join Date: Jan 2003 Location: San Francisco, CA (USA) Posts: 7,875 you can make it one. http://proto.layer51.com/d.aspx?f=65 __________________ (6)

 Thread Tools Display Modes Rate This Thread Linear Mode Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is Off HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home ActionScript Forums Group     ActionScript 3.0     ActionScript 2.0     ActionScript 1.0 (and below)     Simple Stuff (Newbies) Flash General Questions     Flash 10 General Questions     Flash 9 General Questions     Flash 8 General Questions     Other Flash General Questions Flex     Flex 2, 3 & 4     Flex 1 Extensions and Plugins     Components     JSFL - Extending Flash Desktop, Mobile and non-browser Environments     AIR (Apollo)     FlashLite / Portable Devices Development     Projectors and CDs Supporting Technologies     HTML and JavaScript     haXe     Server-Side Scripting     Flash Remoting     Flash Media Server General     Best Practices     Gaming and Game Development     Animation and Effects     Flashants Support Forum Community Boards     General Chat     Just for Kicks Challenges     Detention Flash In Action     Site Check     Cool Sites     Widgets Decommissioned     Projects and Positions CMS Forums     Announcements Board     Content Postings / Updates     Product Review Requests     CMS Technical Questions     Process Questions     Collaboration & Suggested Articles

All times are GMT. The time now is 01:30 AM.

///