Marc Zandvliet wrote:
>
> I've defined a field as numeric(5,2) - I'm using it for monetary amounts.
>
> After inserting values such as 8.50 or 29.00 into the database, a select
> from within psql gives the correct amount, i.e.
> -------
> 23.65
> 21.25
> 8.50
> 31.95
> 25.15
> 20.75
> 18.75
> 32.60
> 52.10
> 29.00
>
> However, windows based queries (through pgAdmin) drop trailing zeros, such
> as 8.5 or 29
>
> Can someone suggest how to prevent this from happening? Obviously I don't
> want to display prices without the decimals. Is it something to do with the
> odbc driver (Insight 6.5 & Postgresql 6.5)?
You can use to_char() to format the output - I forget the exact details
(I've only used it for date output), but there is a whole section
devoted to formatting with to_char() in the manual and it's a very
useful function.
Not sure if it was available at 6.5.? though - maybe 6.5.3. Definitely
in 7.0.x .
Cheers,
Andrew.
--
_____________________________________________________________________
Andrew McMillan, e-mail: Andrew@catalyst.net.nz
Catalyst IT Ltd, PO Box 10-225, Level 22, 105 The Terrace, Wellington
Me: +64 (21) 635 694, Fax: +64 (4) 499 5596, Office: +64 (4) 499 2267