title: Round a number to the next HIGHEST 10
body: <p>I have a need to create a graph, where the scale of the Y-axis changes depending on the data input into the system.  Conceivably this scale could be anywhere from 0-10, 0-100, or even have bottom limit of thousands and an upper limit of millions.</p>
  
  <p>To properly determinethe scale of this axis, I need to work out the ratio of Points to Pixels (based on graph height/range).
  Now a graphs' axis never start at the lowest value and go to the highest, usual practice is to go to the next nearest 2, 5 or 10 (above for upper limit, and below for lower) depending on the range of values.</p>
  
  <p>So what I'd like to know is how to take the max value from the data set, and round it up to the nearest 10.
  for clarification, the input values will <strong>always</strong> be integers.</p>
  
  <p>what i have now is this</p>
  
  <pre><code>        if ((rangeMax &lt; 10) &amp;&amp; (rangeMax &gt; 5))
              rangeMax = 10;
          else if (rangeMax &lt; 5)
              rangeMax = 5;
  </code></pre>
  
  <p>Which is only useful for values less than 10, and doesn't allow the flexibility required to be truly dynamic.  Ultimately this graph will be auto-generated during a page load event, with no user input.</p>
  
  <p>I've read around a bit, and people talk about things like the modulus operator (%), but I can't find any reliable information about it's use, and talk of Math.Ceiling and Math.Round, but these go to the next nearest whole number, which isn't quite there, and don't seem to help much at all when dealing with integers anyway.
  Any suggestions, pointers or help greatly appreciated.</p>
  
  <p>i did find a similar question asked here <a href="https://stackoverflow.com/questions/8244721/how-can-i-get-the-next-highest-multiple-of-5-or-10">How can i get the next highest multiple of 5 or 10</a> but i don't know java, so i can't understand any of what was said.</p>
  
  <p>Cheers</p>