Re: cast numeric with scale and precision to numeric plain - Mailing list pgsql-general

From Adrian Klaver
Subject Re: cast numeric with scale and precision to numeric plain
Date
Msg-id 430396531.6053661256071567996.JavaMail.root@sz0030a.emeryville.ca.mail.comcast.net
Whole thread Raw
In response to Re: cast numeric with scale and precision to numeric plain  (Sim Zacks <sim@compulab.co.il>)
List pgsql-general
----- "Sim Zacks" <sim@compulab.co.il> wrote:

> >> According to the documentation, numeric is stored without any
> leading
> >> or trailing zeros.
> >>
> >
> > That says *stored*; it doesn't say *displayed*.
> >
> >             regards, tom lane
> >
> If it displays them, it has to know they exist. That means it stores
> it
> somewhere.
> > The part of the above that you need to look at is where it says it
> does not
> > store 'any extra leading or trailing zeroes'. In your case you
> entered the
> > value with three trailing zeroes which are taken to be significant
> (see Toms
> > reply also). If you had inserted just 15 you would have gotten back
> 15.
> >
> I guess that's a matter of interpretation. To me zeros after a
> decimal
> point without anything else after them are extra.

See below for an explanation of why the above statement is incorrect.
http://en.wikipedia.org/wiki/Significant_figures



Adrian Klaver
aklaver@comcast.net


pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: cast numeric with scale and precision to numeric plain
Next
From: Pavel Stehule
Date:
Subject: Re: Function returning 2 columns evaluated twice when both columns are needed