• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Decimal precision and scale

 
mark I thomas
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For Decimal(10,5). It means totaly 10 digits and 5 digits after decimal. Here are my questions:

1) is 12.34567890 valid ? it has 10 digits total but more than 5 digits after decimal.

2) is 1234567.89 valid ? it has total 9 digits, and its right side has only 2 digits.

 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let's try:

When you specify more digits after decimal point than allowed, the value will be silently rounded. On the other hand, inserting a value with too much digits before the decimal point will cause an error. As far as I know this behaviour is defined by SQL standard and should be the same in all databases.
 
mark I thomas
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my appreciation to the answer.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic