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 Thu, Oct 8, 2009 at 6:04 PM, 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?  I'm guessing numeric(2,3) should
> be fine, yes?  I'm not too familiar with the numeric type (I was using
> "real" before), but as I understand the data will be stored using the
> necessary number of bits on the disk?  Thanks!

numeric(2,3) is not possible :-). IMO, a percentage should be stored
numeric(6,3) or so.  That gives up to 100% down to thousandth of a
percent.

merlin

-- 
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