A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: rounding variables

  1. #1

    rounding variables

    How do round off a variable to the closest 100?

  2. #2
    Probably Your Saviour :)
    Join Date
    Mar 2000
    Location
    Uk
    Posts
    17
    in what? php? flash?

    its pretty easy tho..

    if you have a large number (2137472 for example) and u want it rounded to the nearest 100, then divide the original number 2137472 by 100, which gives 21374.72... use a round function to get rid of the .72, then multiply it by 100 again..

    Code:
    count = 2137472;
    var = Math.Round(count/100)*100;
    you should be more depth with your questions to be honest...

  3. #3
    Me so stupid.

    Tanks, and yes there was no depth in in my question, sorry

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center