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. Database & SysAdmin
  3. Database
  4. Simple problem but irriatating me

Simple problem but irriatating me

Scheduled Pinned Locked Moved Database
helpquestion
2 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.
  • S Offline
    S Offline
    sandeep kumar pundhir
    wrote on last edited by
    #1

    hi can anyone please help me I have declare @Z decimal set @Z=0.1 select @Z the out put comes to be 0 WHY ? it shud be 0.1 Thanx

    M 1 Reply Last reply
    0
    • S sandeep kumar pundhir

      hi can anyone please help me I have declare @Z decimal set @Z=0.1 select @Z the out put comes to be 0 WHY ? it shud be 0.1 Thanx

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      You haven't specified the precision or scale parameters of the decimal type. Precision specifies the total number of decimal digits that can be stored, while scale specifies the number of digits to the right of the decimal point. The maximum number of digits to the left of the decimal point is then (precision - scale). If you don't specify these parameters, the default scale is 0 - so anything to the right of the decimal point is discarded and not stored. To store a number between -9.9 and 9.9, with one decimal place, you would say

      declare @Z decimal**(2,1)**

      -- modified at 6:08 Wednesday 23rd August, 2006 (forgot closing bold tag)

      Stability. What an interesting concept. -- Chris Maunder

      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