Re: Best data type to use for sales tax percent

From: Lew <noone(at)lwsc(dot)ehost-services(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Best data type to use for sales tax percent
Date: 2009-10-09 03:34:38
Message-ID: hamb0g$nha$1@news.albasani.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Rich Shepard wrote:
> On Thu, 8 Oct 2009, Mike Christensen wrote:
>
>> I'll probably just use 3,3 and store this value between 0 and 1, since
>> all
>> I'll be doing with this number is using it to multiply against a
>> subtotal. 3,3 gives me 0.000 through 0.999, correct?
>
> Mike,
>
> No. The two digits represent the width of the column and the number of
> significant digits. Try (4,3).

That will fail for the scenario that Christope Pettus pointed out. California
is not the only state with sales tax specified to a quarter point., or even a
tenth of a point as in Missouri, where a local sales tax can be 9.241%, and
equal or exceed 10%, as in Alabama, Arizona, California and Illinois.
<http://en.wikipedia.org/wiki/Sales_taxes_in_the_United_States>

It's a good idea to research the domain before deciding on the representation.

--
Lew

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Bailey 2009-10-09 05:24:38 Re: Tips/Hacks to create minial DB from the execution of several (simple) SQL requests.
Previous Message Scott Marlowe 2009-10-09 01:16:20 Re: interface for "non-SQL people"