November 10, 2009

NUMBER Datatype - Scale greater than Precision

Number(p,s) is one of the numeric datatypes available in Oracle.
Where p is the precision and s is the scale.
For example, number(7,2) is a number that has 5 digits before the decimal and 2 digits after the decimal -> 12345.67

You can specify a scale that is greater than precision, although it is uncommon.
In this case,
  1. Only digit before the decimal point is 0 (zero)
  2. Scale s specifies the maximum number of digits to the right of the decimal point
  3. Scale-Precision s-p specifies the minimum number of zeros present after the decimal point
For example, number(2,7) can store 0.0000012.
Maximum number of digits to the right of the decimal point is 7
Minimum number of zeros present after the decimal point is 7-2=5

2 comments:

  1. I was suggested this web site by my cousin. I am not sure whether this post is written by him as no one else know such detailed about my difficulty.
    You are incredible! Thanks!

    My page; bmi chart female

    ReplyDelete
  2. Genuinely when someone doesn't know then its up to other viewers that they will assist, so here it happens.

    Also visit my weblog ... anti cellulite treatment

    ReplyDelete