Search Postgresql Archives

Re: Best data type to use for sales tax percent

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2009-10-08, Mike Christensen <mike@xxxxxxxxxxxxx> 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.

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux