phillip Posted November 24, 2004 Posted November 24, 2004 Guys How can I round a figure to the nearest 0.05? For example 0.14 to equal 0.15 2.52 to equal 2.50 Phill Quote phillip Restall
Leaders Iceplug Posted November 24, 2004 Leaders Posted November 24, 2004 Divide the number by 0.05, round it to the nearest integer, and then multiply by 0.05. 0.14 / 0.05 = 2.8 -> 3, 3 * 0.05 = 0.15 2.52 / 0.05 = 50.4 -> 50, 50 * 0.05 = 2.50 :) Rounding to the nearest integer being Math.Round(num, 0) Quote Iceplug, USN One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.