Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8681745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:35:26+00:00 2026-06-12T21:35:26+00:00

How would I round to the nearest 5000 in vb.net. Can’t use math.round cause

  • 0

How would I round to the nearest 5000 in vb.net. Can’t use math.round cause it gives error. I’m looking for something like mround() in microsoft exel.

  Math.round(43333 * 34, 5000)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T21:35:27+00:00Added an answer on June 12, 2026 at 9:35 pm

    Try

    Math.Round(43000 / 5000) * 5000
    

    As in:

    For Each x In New Single() {2499, 2501, 7000, 21000, 43000, 99000}
        Console.WriteLine(String.Format( _
                "Rounding {0,7:N0} to the nearest 5,000: {1,7:N0}", _
                x, _
                Math.Round(x / 5000) * 5000) _
            )
    Next
    
    Console.ReadKey(True)
    

    Outputs:

    Rounding   2,499 to the nearest 5,000:       0
    Rounding   2,501 to the nearest 5,000:   5,000
    Rounding   7,000 to the nearest 5,000:   5,000
    Rounding  21,000 to the nearest 5,000:  20,000
    Rounding  43,000 to the nearest 5,000:  45,000
    Rounding  99,000 to the nearest 5,000: 100,000
    

    I’ll add that the default rounding behavior for Math.Round is MidpointRounding.ToEven which the documentation describes as “When a number is halfway between two others, it is rounded toward the nearest even number.” This means that 0.5 may be rounded to 0 or 1 depending on the circumstances (which is the desired behavior when dealing with statistics). To change this behavior, you can pass MidpointRounding.AwayFromZero as the second parameter, which will behave as you were taught in school (0.5 always rounds to 1, -0.5 always rounds to -1).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How would I CORRECTLY round a BigDecimal to the nearest whole value? For instance
Suppose I would like to round up float to int in Java . For
I would like my text entry to round off decimals and have the end
How can I round a number to the nearest X value (for example 50)
Using Javascript, I would like to round a number passed by a user to
I would like to write something which looks a bit like what I currently
How would I round down to the nearest integer in MySQL? Example: 12345.7344 rounds
I would like an elegant way to round a java Date up or down
I'me looking for a function that would receive a time and would round it
I would like to round the corners of the ListView. I have tried to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.