From: | David <dbree(at)duo-county(dot)com> |
---|---|
To: | Sean Davis <sdavis2(at)mail(dot)nih(dot)gov> |
Cc: | operationsengineer1(at)yahoo(dot)com, "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org> |
Subject: | Re: SQL Count Magic Required.... First Iteration... |
Date: | 2006-06-01 23:49:18 |
Message-ID: | 20060601234918.GA1486@localhost.localdomain |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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)?
From | Date | Subject | |
---|---|---|---|
Next Message | operationsengineer1 | 2006-06-02 00:37:05 | Re: SQL Count Magic Required.... Third Iteration... |
Previous Message | operationsengineer1 | 2006-06-01 19:14:27 | Re: SQL Count Magic Required.... Second Iteration... |