Results 1 to 2 of 2

Thread: round to nearest hundred...

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2002
    Location
    phoenix arizona
    Posts
    8

    Red face round to nearest hundred...

    okie dokie, i just need the simplest code/ function / anything to round to the nearest hundred. like if i have 1246 i want 1200 if i have 1256 i want 1300, no big deal, need it for school, but not neccasarrily just those two numbers yaknow ?

  2. #2
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    VB Code:
    1. Private Sub Command1_Click()
    2. MsgBox NearestHundred(1249)
    3. End Sub
    4.  
    5. Private Function NearestHundred(num As Long)
    6. NearestHundred = Round(num / 100, 0) * 100
    7. End Function
    <removed by admin>

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