Received: from water.oasis.net.au (water.oasis.net.au [210.8.139.2]) by postgresql.org (Postfix) with ESMTP id 587AA474E71 for ; Sun, 21 Jul 2002 20:02:58 -0400 (EDT) Received: from oasis.net.au (guardian [210.8.139.5]) by water.oasis.net.au (8.9.3/100.1) with ESMTP id KAA27494 for ; Mon, 22 Jul 2002 10:17:51 +1000 X-Authentication-Warning: water.oasis.net.au: Host guardian [210.8.139.5] claimed to be oasis.net.au Message-ID: <3D3B4C68.1040500@oasis.net.au> Date: Mon, 22 Jul 2002 10:06:00 +1000 From: Rudi Starcevic User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.1a+) Gecko/20020711 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Float / Numeric ? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200207/317 X-Sequence-Number: 8695 Hi Folks, I have an ecommerce application I'm writing and I'm not sure / undecided on a particular way to store shipping rates in PostgreSQL In this application a user may set the shipping rate per item. So I have 3 fields - local,state and international. A forth field, shipping_type (varchar), holds a value 'dollars' or 'percent'. My twisted logic says a user may say this item has 10 perent shipping to add or 10 dollars to add. This means the shipping rate my be either dollars or percent and can be set on a per item basis. For the 3 fields I'm not sure which is best to use - Float or Numeric ? My application language is ColdFusion and PHP. I'd like to ask which data type would be the better choice. At this stage I'm using Float to represent a value that may be either dollars or percent. Perhaps this technique, using a varchar as a type of switch (shipping_type) , is incorrect / silly / stupid / not robust enough or just plain wrong. Do you think this is OK and if so which would you use - Floast or Numeric ? Thanks for your time. Cheers Rudi.