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

  • Home
  • SEARCH
  • 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 8096333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:25:20+00:00 2026-06-05T21:25:20+00:00

I don’t want use old Visual Basic methods in my code, and I’m confused

  • 0

I don’t want use old Visual Basic methods in my code, and I’m confused about what’s the newest VB.NET method corresponding to the old CInt() Visual Basic method.

For example,

Dim n1 as Double : n1 = CInt(2.1111111) 'Gets only 2 without rounding it
Dim n2 as Double : n2 = CInt(2.7777777) 'Get only 2 without rounding it
  • 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-05T21:25:23+00:00Added an answer on June 5, 2026 at 9:25 pm

    You can use CInt in VB.NET as well. It is a standard type conversion function supported by the VB.NET compiler. There is no reason to avoid it.

    However, nearly every type conversion operation will round to the nearest integer (including other methods such as Convert.ToInt32, etc.), not truncate. You can force a truncation by using Int or Fix (which have different behaviors for negative numbers).

    Note that, you can do the same as Int/Fix by using Math.Truncate and Math.Floor, should you wish to avoid the VB.NET specific conversion routines.


    On a side note – CInt in Visual Basic 6.0 also performed rounding. The behavior in VB.NET for CInt is the same as in Visual Basic 6.0.

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

Sidebar

Related Questions

Don't be frightened, its a very basic code. Just wanted to check with you
I don't like Jackson. I want to use ajax but with Google Gson. So
Don't ask me why but i can't use this method because I need to
Don't be scared of the extensive code. The problem is general. I just provided
I don't want to know a way to preload images, I found much on
Don't know if I worded the question right, but basically what I want to
Don't be afraid to use any technical jargon or low-level explanations for things, please.
Don't they both have to convert to machine code at some point to execute
Don't know what's wrong here, when I run the application it says Specified method
Don't know a whole lot about streams. Why does the first version work using

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.