Re: Best data type to use for sales tax percent

Поиск
Список
Период
Сортировка
От Jasen Betts
Тема Re: Best data type to use for sales tax percent
Дата
Msg-id hapn5o$unr$2@reversiblemaps.ath.cx
обсуждение исходный текст
Ответ на Best data type to use for sales tax percent  (Mike Christensen <mike@kitchenpc.com>)
Список pgsql-general
On 2009-10-08, Mike Christensen <mike@kitchenpc.com> wrote:
> (Sorry for the super-easy question)
>
> I want to store sales tax (as a percent) in the DB, such as 9.5%.
> What's the best data type for this?

real, or numeric, probably numeric.

> I'm guessing numeric(2,3) should be fine, yes?

depends on the range of values you want to store.

generally percentages are most usefully represented as decimal fractions
especially if you intend to do arithmetic with them.

numeric reccomended useful for financial stuff.

В списке pgsql-general по дате отправления:

Предыдущее
От: Jasen Betts
Дата:
Сообщение: Re: automated row deletion
Следующее
От: Jasen Betts
Дата:
Сообщение: Re: Best data type to use for sales tax percent