Re: Best data type to use for sales tax percent - Mailing list pgsql-general

From Jasen Betts
Subject Re: Best data type to use for sales tax percent
Date
Msg-id hapn5o$unr$2@reversiblemaps.ath.cx
Whole thread Raw
In response to Best data type to use for sales tax percent  (Mike Christensen <mike@kitchenpc.com>)
List 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 by date:

Previous
From: Jasen Betts
Date:
Subject: Re: automated row deletion
Next
From: Jasen Betts
Date:
Subject: Re: Best data type to use for sales tax percent