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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. a problem about datatype

a problem about datatype

Scheduled Pinned Locked Moved Database
helpquestion
5 Posts 3 Posters 2 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.
  • N Offline
    N Offline
    nibabug
    wrote on last edited by
    #1

    hello everyone :) i define a datatype float, but when i write a value, for exsample '1.123',to the table, then i find that the value in the table changed to '1.123999999999999', what's the problem? thanks a lot :-D

    wuhuaiji

    N M 2 Replies Last reply
    0
    • N nibabug

      hello everyone :) i define a datatype float, but when i write a value, for exsample '1.123',to the table, then i find that the value in the table changed to '1.123999999999999', what's the problem? thanks a lot :-D

      wuhuaiji

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      By default float size will be 8. Try reducing it

      All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

      N 1 Reply Last reply
      0
      • N N a v a n e e t h

        By default float size will be 8. Try reducing it

        All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

        N Offline
        N Offline
        nibabug
        wrote on last edited by
        #3

        thanks , but it can not be reduced

        wuhuaiji

        N 1 Reply Last reply
        0
        • N nibabug

          hello everyone :) i define a datatype float, but when i write a value, for exsample '1.123',to the table, then i find that the value in the table changed to '1.123999999999999', what's the problem? thanks a lot :-D

          wuhuaiji

          M Offline
          M Offline
          Marek Grzenkowicz
          wrote on last edited by
          #4

          Read about floating-point[^] and then use decimal and numeric data type.

          1 Reply Last reply
          0
          • N nibabug

            thanks , but it can not be reduced

            wuhuaiji

            N Offline
            N Offline
            N a v a n e e t h
            wrote on last edited by
            #5

            nibabug wrote:

            but it can not be reduced

            I guess you tried through enterprise manager right ? Try through query analyzer, you can change it.

            All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

            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