Re: SQL Count Magic Required.... First Iteration...

Поиск
Список
Период
Сортировка
От David
Тема Re: SQL Count Magic Required.... First Iteration...
Дата
Msg-id 20060601234918.GA1486@localhost.localdomain
обсуждение исходный текст
Ответ на Re: SQL Count Magic Required.... First Iteration...  (Sean Davis <sdavis2@mail.nih.gov>)
Список 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 по дате отправления:

Предыдущее
От:
Дата:
Сообщение: Re: SQL Count Magic Required.... Third Iteration...
Следующее
От: "Travis West"
Дата:
Сообщение: Locale and Initdb Errors