Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Numeric Data Types > DEC, DECIMAL, FIXED, NUMERIC

Name

DEC, DECIMAL, FIXED, NUMERIC

Synopsis

DECIMAL[(width[, decimals])] [UNSIGNED] [ZEROFILL]

This data column type is similar to FLOAT, but it’s used for accurate, fixed-point numbers. When calculating with a DECIMAL column, it has a 65-digit level of precision. The width given is the maximum width of the total digits—on both sides of the decimal place, not including the decimal point or the negative sign if a negative number. The decimals given are the number of decimals allowed and the number for which it zero-fills. For example, a column type setting of DECIMAL(4,2) that is given a value of 123.4 will return a warning and store the value as 99.99, the maximum amount given the width. If the same column is given a value of 12.3, it won’t generate any warnings and will store the value as 12.30. If UNSIGNED is used with DECIMAL, negative values are not allowed.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint