Re: [GENERAL] cast numeric with scale and precision to numeric plain

2009-10-21 Thread Scott Bailey
Sim Zacks wrote: I'm using 8.2.4 Numeric with scale precision always shows the trailing zeros. Numeric plain only shows numbers after the decimal point that are being used. I would like to have the data in my table with scale and precision, but my views to be cast to numeric without any scal

Re: [GENERAL] cast numeric with scale and precision to numeric plain

2009-10-20 Thread Adrian Klaver
- "Sim Zacks" 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. T

Re: [GENERAL] cast numeric with scale and precision to numeric plain

2009-10-20 Thread Scott Marlowe
2009/10/20 Sim Zacks : > I guess that's a matter of interpretation. To me zeros after a decimal > point without anything else after them are extra. >From a mathematical perspective, they most certainly are not extra. 15.000 15.001 15.002 15.003 Each have three digits of precision, and each mean

Re: [GENERAL] cast numeric with scale and precision to numeric plain

2009-10-20 Thread Sim Zacks
>> 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

Re: [GENERAL] cast numeric with scale and precision to numeric plain

2009-10-20 Thread Tom Lane
Sim Zacks writes: >>> I'm not sure offhand what is the easiest way to suppress trailing >>> zeroes, but casting to plain numeric is not the route to a solution. > According to the documentation, numeric is stored without any leading > or trailing zeros. That says *stored*; it doesn't say *displa

Re: [GENERAL] cast numeric with scale and precision to numeric plain

2009-10-20 Thread Adrian Klaver
On Tuesday 20 October 2009 3:39:22 am Sim Zacks wrote: > Numeric with scale precision always shows the trailing zeros. > Numeric plain only shows numbers after the decimal point that are being > used. > > > That statement is false: > > regression=# select 1234.000::numeric; > numeric > --

Re: [GENERAL] cast numeric with scale and precision to numeric plain

2009-10-20 Thread Sim Zacks
Numeric with scale precision always shows the trailing zeros. Numeric plain only shows numbers after the decimal point that are being used. That statement is false: regression=# select 1234.000::numeric; numeric -- 1234.000 (1 row) I'm not sure offhand what is

Re: [GENERAL] cast numeric with scale and precision to numeric plain

2009-10-19 Thread Tom Lane
Sim Zacks writes: > Numeric with scale precision always shows the trailing zeros. > Numeric plain only shows numbers after the decimal point that are being > used. That statement is false: regression=# select 1234.000::numeric; numeric -- 1234.000 (1 row) I'm not sure offhand what i

[GENERAL] cast numeric with scale and precision to numeric plain

2009-10-19 Thread Sim Zacks
I'm using 8.2.4 Numeric with scale precision always shows the trailing zeros. Numeric plain only shows numbers after the decimal point that are being used. I would like to have the data in my table with scale and precision, but my views to be cast to numeric without any scale or precision. Ho