473,320 Members | 2,024 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Visual Basic Calculator: Need to convert decimal answer into integer

I am using Visual Basic 2008 Express Edition. I am making a calculator that should calculate and display the number of filled vans (LblFilledVans.Text), the number of filled cars (LblFilledCars.Text) and the number of people left over (LblPplLeftOver.Text). In order to do this I am supposed to be able to type in the total number of people in the text box (TxtPeople.Text) and it should display all of the answers I need. I have already coded this. But I want all of my answers (filled cars,filled vans&people left over) to come out as whole numbers and they keep coming out as decimals. Is there a code I can use to change this? And where do I put it? Plz help. Thanks.
Oct 14 '10 #1
1 1702
danp129
323 Expert 256MB
Angel,
Please post in "Visual Basic.Net" in the future. This also sounds like homework which is against the rules and this post will likely get deleted.

I won't give you an example but some advice. Declare variables to hold the whole numbers as data type that is for whole numbers. If you do a multiply/divide on these, the returned data type will likely not be a datatype that is for whole numbers. In that case you can do a little research to get these back to whole numbers.

Homework is important and for the lesson, you should research:
cLng() or cInt()
[Integer/Long].[Parse()/TryParse()]
Math.floor
Math.ceiling
Math.round
Data Types
Oct 14 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Raja | last post by:
Dear Members, Has anyone used the Vector Draw (www.vdraw.com) Component in Visual Basic. I need to create an application to be able to draw the plan view of a building. Any help in this regard...
27
by: code_wrong | last post by:
Visual Basic (not dot net) what is the best way to check the User has entered an integer into an InputBox? isNumeric() checks for a numeric value .. but does not notify of numbers with decimal...
1
by: SSPoke | last post by:
Hello I attempted to make one in VB.NET but it dind't work at all.. Private buffer() As Byte 'OUTPUT OF BITS goes here Dim bitPosition as Integer = Buffer(i) * 8 'current position of Buffer...
19
by: TexasNewbie | last post by:
This was originally just a calculator without a decimal point. After I added the decimal, it now tells me invalid second number. //GUI Calculator Program import javax.swing.*; import...
2
by: Faraz Meghani | last post by:
Hello, I am trying to build an SQL in Visual Basic and need some help with quotation mark(s). I have two text fields on a form where the user enters a sales group range to view records...
6
by: mrtopher | last post by:
I'm in a visual basic programming class at my community college and I'm having one hell of a time trying to figure this out. I'm supposed to create a weekly pay calculator as a project for class, so...
1
by: chrspta | last post by:
I am new to Visual basic. I need a program using VB6 that converts txt files to excel file.Description is in the below: The form should have the Drive list, Dir list, file list and cmdConvert...
7
by: godhulirbalaka | last post by:
Hi guys, I am making a shop management program in visual basic. I want to a menu name Utiliti where Calculator, notepad, heart game, solitair game will be shown. In Utility menu I added this submenu....
14
by: princedhump | last post by:
Hi everyone, I am making a game in Visual Basic. I need some help with it. My question is: that when the user would click the Next button on the Form, the next Question should show! I have 15...
1
napster161
by: napster161 | last post by:
1st Question: Correction: BINARY to HEXADECIMAL I have write some simple code for this matter public class DecimalToHexadecimal{ public static void main(String args) throws IOException{ ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.