Using Decimal Types. What are the data types that you can use? Decimal Number: Single -Is used for decimal values that will not exceed six or seven digits.

Slides:



Advertisements
Similar presentations
Ch. 3 Variables VB.Net Programming. Data Types Boolean – True or False values Short – Small integers (+/- 32,767) Integer – Medium-size integers (+/-
Advertisements

Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
Excel Chapter 6 Review slides. How many worksheets are in a workbook, by default? three.
Access VBA Programming for Beginners - Class 1 - by Patrick Lasu
Copyright © 2001 by Wiley. All rights reserved. Chapter 3: Variables, Assignment Statements, and Arithmetic Variables Assignment Statements Arithmetic.
Converting Fractions we have looked at converting FRACTIONS to DECIMALS. We can also show fractions as PERCENTAGES. PER CENT means OUT OF (per)
Chapter 8: String Manipulation
Lesson 4: Formatting the Worksheet
Introduction to Access By Mary Ann Chaney and Alicia Harkleroad.
CS0004: Introduction to Programming Input and Output.
Window Quick Tips: hold down CTRL and spin the mouse wheel to zoom in and out hold down the ALT key and tap the TAB key to flip between open programs (like.
February 2006Colby College ITS Formatting Techniques for Excel 2003.
Excel Project 2 FORMULAS, FUNCTIONS, FORMATTING AND WEB QUERIES.
Let’s get started using Visual Basic!. Private Sub cmdGo_Click... Dim strMessage As String Dim sngSum As Single If IsNumeric(txtNumber1.Text) = False.
A lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. a lesson approach Microsoft® Excel 2010 © 2011 The McGraw-Hill Companies,
CSC 162 Visual Basic I Programming. Randomizing and Formatting Randomizing Formatting –User-Defined Formats –Named Numeric Formats.
Lab 01 Forms in excel Tahani ALdweesh Insert form into your project. 2. Change form’s properties. 3. Put controls on the form. 4. Change controls’
Review for Mid-term! October 26, Review Homework Worksheet True or False Operators are symbols that perform specific operations in Visual Basic.
1 ADVANCED MICROSOFT EXCEL Lesson 9 Applying Advanced Worksheets and Charts Options.
Percents.
Scientific Notation Quick Review. Powers of 10 cienceopticsu/powersof10/
Transparency 4 Click the mouse button or press the Space Bar to display the answers.
Excel Project 2 Formulas, Functions, and Formatting.
Transparency 6 Click the mouse button or press the Space Bar to display the answers.
Do Loop with Interest Please see speaker notes for additional information!
WHAT IS A DATABASE? A DATABASE IS A COLLECTION OF DATA RELATED TO A PARTICULAR TOPIC OR PURPOSE OR TO PUT IT SIMPLY A GENERAL PURPOSE CONTAINER FOR STORING.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 3 Variables, Constants, Methods, and Calculations.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 24 The String Section.
A Simple Guide to Using SPSS ( Statistical Package for the Social Sciences) for Windows.
Data Types and Variables. Data Type! Computers are all about Data! Data can be in the form of Text Dates Sounds Pictures.
Chapter 5 Working with Multiple Worksheets and Workbooks
The Advantage Series © 2004 The McGraw-Hill Companies, Inc. All rights reserved Creating Select Queries Chapter 6 Microsoft Office Access 2003.
Salary Calculator. Design a page like the following.
1 Chapter 3 – Examples The examples from chapter 3, combining the data types, variables, expressions, assignments, functions and methods with Windows controls.
Salary Calculator. Design a page like the following.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 7 Where Can I Store This?
Chapter 8.  Visual Basic includes several built-in mathematical functions ◦ Abs ◦ Sqr ◦ Sgn ◦ IsNumeric ◦ Round ◦ Format ◦ Pmt ◦ PV ◦ FV.
Lesson 4 Mathematical Operators! October 6, 2009.
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
Vijayalakshmi G M Validation Controls.
Transparency 1 Click the mouse button or press the Space Bar to display the answers.
Variables Continued In the last session we saw how variables are objects that allow us to store values in the RAM of the computer In this session we shall.
A: A: double “4” A: “34” 4.
Introduction to Programming Python Lab 5: Strings and Output 05 February PythonLab5 lecture slides.ppt Ping Brennan
Transparency 9 Click the mouse button or press the Space Bar to display the answers.
Calculator Program Explained by Arafa Hamed. First Designing The Interface Ask yourself how many places are there that will be used to input numbers?
Object-Oriented Application Development Using VB.NET 1 Chapter 4 VB.NET Programming with Supplied Classes.
Microsoft Access Prepared by the Academic Faculty Members of IT.
Adding Code to the Option Button. Open VB 1.Double click the Calculate button and select General from the Object list box. 2.Add the following code to.
Creation of Variables with Numeric, alphanumeric, date, picture, memo data types Constant - A quantity that does not change during the execution of a program.
We use the ( % ) symbol instead of writing fractions with a denominator of 100.
Resource Review Excel formula basics Demonstrate how to enter manual formulas Examine some of the available functions and their usage Discuss the.
Chapter 4.  Variables – named memory location that stores a value.  Variables allows the use of meaningful names which makes the code easier to read.
Visual Basic/ Visual Studio Brandon Large. Connecting to prior knowledge In your notes write down what the two main parts of the computer are. The “software”
INTRODUCTION TO DATABASE USING MICROSOFT ACCESS 2013 Part 5.1 November 16, 2014.
DATA TYPES.
Introduction to Programming
Arithmetic operations and operators, converting data types and formatting programs for output. Year 11 Information Technology.
How to Process a Credit Card SALE Transaction in PCCharge
Microsoft Excel.
Project 9 Creating Pop-up Windows, Adding Scrolling Messages, and Validating Forms.
Do Now Pg 52 #18-21.
Excel Formatting Rules
Microsoft Visual Basic 2005 BASICS
Please use speaker notes for additional information!
CSI 101 Elements of Computing Spring 2009
Microsoft Visual Basic 2005 BASICS
Objective The student will be able to:
Data Types and Expressions
Working with Formulas and Functions
Presentation transcript:

Using Decimal Types

What are the data types that you can use? Decimal Number: Single -Is used for decimal values that will not exceed six or seven digits. Double - Is used for decimal values with more than six or seven digits. Currency - Is used when working with dollars and cents.

Using the Format Function! Allows you to apply custom formatting to a number before displaying the value. Use it for: –Decimal values –Phone numbers –Currency $$$$$ –Social security numbers –ID numbers –Dates –Time

How? You specify the format you want using special symbols. For example: Display to appear as $1, strAmount = Format( , “$#,###.00”)

Formatting Symbols SymbolDescription 0 The 0 symbol causes a digit to appear in the space. If the data has no value for that digit, a zero appears. # Is similar to the 0 symbol. The difference is that nothing appears in the space if the number being formatted does not require that digit to be used.. The period is used to specify where you want the decimal point to appear in the format.

SymbolDescription, By placing commas in the format it will appear in the format. % The percent sign causes a number to be multiplied by 100 and a percent sign to be placed at the end of the number.

Examples! CodeResult Format( , “ ” Format( , “######.000”) Format( , “######.###”) Format( , “###,###.##”) 12,345,67 Fomat( , “$###,###.##”) $12, Format(0.89, “##%”) 89%

Let’s look at a program. Open Visual Basic Open the Dog Years program from the c:\drive. Double click the Calculate age in months. Enter the following code: ‘Display Number of Months Old lblOutputMonths.Caption = “You are” & intMonths & “months old.” lblOUtputMonths.Visible = True

Double click the Calculate age in months. Enter the following code: ‘Display Instructions lblInstructions.Visible = True Double click the Dog button. Enter the following code: Dim strYears As String Dim sngYears As Single ‘Calculate Dog Years sngYears = (7 * intMonths) / 12 ‘Hide Instructions lblInstructions.Visible = False

‘Display Results strYears = Format(sngYears, “###.0”) lblOutputAnimalYears.Caption = “In dog years, you are “ & strYears & “years old.” lblOutputAnimalYears.Visible = True

Close the code window and run the program. Enter 15 in the Age in years Enter 4 in the Months since last birthday Click the Calculate age in months and dog buttons. What happens?