Re: SQL Count Magic Required.... First Iteration... - Mailing list pgsql-novice

From David
Subject Re: SQL Count Magic Required.... First Iteration...
Date
Msg-id 20060601234918.GA1486@localhost.localdomain
Whole thread Raw
In response to Re: SQL Count Magic Required.... First Iteration...  (Sean Davis <sdavis2@mail.nih.gov>)
List pgsql-novice
On Thu, Jun 01, 2006 at 02:28:29PM -0400, Sean Davis wrote:
>
> > in my test case, i have 5 passes and 9 total and 5/9
> > is displayed as
> >
> > 0.55555555555555...
> >
> > should i format this in my application code, or does
> > pgsql allow for formatting?  i want to display 55.5%.
>
> I would do this on the client side, but it doesn't make any particular
> difference. Allows you to maintain a separation of your model from your
> view.
>
> http://www.postgresql.org/docs/8.1/static/functions-math.html
>
> See the trunc function.

Or how about casting the answer to numeric(3,1) ( or whatever precision
is desired)?

pgsql-novice by date:

Previous
From:
Date:
Subject: Re: SQL Count Magic Required.... Third Iteration...
Next
From: "Travis West"
Date:
Subject: Locale and Initdb Errors