Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
MSDN Visual Basic Community
 
 
 
 
 
 
TitleRound a number to a multiple of some number
Keywordsround off, digits, multiple
CategoriesAlgorithms
 
Divide by the second number, round to the nearest integer, and then multiply by the second number again.
 
' Round a value to the nearest multiple of a number.
Private Function RoundToMultiple(ByVal value As Double, _
    ByVal multiple As Integer) As Double
    RoundToMultiple = CInt(value / multiple) * multiple
End Function
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated