Sign In | Subscribe
Start learning today, and be successful in your academic & professional career. Start Today!
Loading video...
This is a quick preview of the lesson. For full access, please Log In or Sign up.
For more information, please see full course syllabus of Visual Basic
  • Discussion

  • Study Guides

  • Table of Contents

Bookmark and Share

Start Learning Now

Our free lessons will get you started (Adobe Flash® required).
Get immediate access to our entire library.

Sign up for

Membership Overview

  • Unlimited access to our entire library of courses.
  • Search and jump to exactly what you want to learn.
  • *Ask questions and get answers from the community and our teachers!
  • Practice questions with step-by-step solutions.
  • Download lesson files for programming and software training practice.
  • Track your course viewing progress.
  • Download lecture slides for taking notes.
  • Learn at your own pace... anytime, anywhere!

Formatting Strings for Output

  • {n} where n is a number, is used as a placeholder inside the formatting string
  • {n, x} where x is added for padding, with negative x is left-aligned, positive x is right-aligned
  • .ToString is the default string formatter
  • Formatting numbers uses the form: number.ToString(“xn”) where
    • n is the number of decimal places
    • x is one of the following:
      • C for Currency
      • P for Percentage
      • N for Generic Number
      • F for Floating Point
  • Binary choices in string output take one of three forms:
    • Format(boolean, “Yes/No”)
    • Format(boolean, “True/False”)
    • Format(boolean, “On/Off”)
  • These are the only three choices available