Re: Best data type to use for sales tax percent

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Mike Christensen <mike(at)kitchenpc(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Best data type to use for sales tax percent
Date: 2009-10-08 23:38:28
Message-ID: b42b73150910081638h42e09fa4j9ee9ef4be3e34ece@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Oct 8, 2009 at 6:04 PM, Mike Christensen <mike(at)kitchenpc(dot)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?  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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mike Christensen 2009-10-08 23:50:47 Re: Best data type to use for sales tax percent
Previous Message Christophe Pettus 2009-10-08 22:39:47 Re: Best data type to use for sales tax percent