Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Decimal Point

Decimal Point

Scheduled Pinned Locked Moved Visual Basic
question
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    WestSideRailways
    wrote on last edited by
    #1

    Hi there, The user input a decimal number 123.456, how do i work on the number behind the decimal point.

    L 1 Reply Last reply
    0
    • W WestSideRailways

      Hi there, The user input a decimal number 123.456, how do i work on the number behind the decimal point.

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Hi, integer numbers can't handle the fractional part. Floating-point numbers can; that is their purpsoe. Look for the Single and Double data types, and the corresponding classes. Double.TryParse() may suit your needs. If this is new to you, I strongly recommend you buy an introductory book on VB.NET and work your way through it. :)

      Luc Pattyn


      try { [Search CP Articles] [Search CP Forums] [Forum Guidelines] [My Articles] } catch { [Google] }


      W 1 Reply Last reply
      0
      • L Luc Pattyn

        Hi, integer numbers can't handle the fractional part. Floating-point numbers can; that is their purpsoe. Look for the Single and Double data types, and the corresponding classes. Double.TryParse() may suit your needs. If this is new to you, I strongly recommend you buy an introductory book on VB.NET and work your way through it. :)

        Luc Pattyn


        try { [Search CP Articles] [Search CP Forums] [Forum Guidelines] [My Articles] } catch { [Google] }


        W Offline
        W Offline
        WestSideRailways
        wrote on last edited by
        #3

        Luc Pattyn wrote:

        ForumVisual Basic / VB.NET Subject:Re: Decimal Point Sender:Luc Pattyn Date:6:13 5 Aug '07 Hi, integer numbers can't handle the fractional part. Floating-point numbers can; that is their purpsoe. Look for the Single and Double data types, and the corresponding classes. Double.TryParse() may suit your needs. If this is new to you, I strongly recommend you buy an introductory book on VB.NET and work your way through it. Luc Pattyn

        Integer numbers can't handle fractions, WELL DUH....Anyone knows that:mad::mad: Everyone needs a little help, now and then, even people like you.........

        L 1 Reply Last reply
        0
        • W WestSideRailways

          Luc Pattyn wrote:

          ForumVisual Basic / VB.NET Subject:Re: Decimal Point Sender:Luc Pattyn Date:6:13 5 Aug '07 Hi, integer numbers can't handle the fractional part. Floating-point numbers can; that is their purpsoe. Look for the Single and Double data types, and the corresponding classes. Double.TryParse() may suit your needs. If this is new to you, I strongly recommend you buy an introductory book on VB.NET and work your way through it. Luc Pattyn

          Integer numbers can't handle fractions, WELL DUH....Anyone knows that:mad::mad: Everyone needs a little help, now and then, even people like you.........

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          Yeah, I need help in guessing which elementary things you know and don't know. The integer part of a floating-point number is available by ... to ..., or by using the ... method, and the fractional part is what is left when you subtract the integer part from it. But of course you knew all that. Now what is the question ? :)

          Luc Pattyn [Forum Guidelines] [My Articles]


          this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/AllLanguages/General - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google


          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups