Subject RE: [ib-support] newbie question : NUMERIC and DECIMAL type diffe rence
Author Wilson, Fred
We use INTEGER for all measurements. We have various rules tables, that
describe the unit of measurement for a particular column.
For instance, postage (which for the US Manifest is in US dollars).. The US
Manifest requires the postage to be to tens of a cent -> $000.001 ...
So the postage column in the Manifest table is defined as an INTEGER, and
the number of "units" in the column, when in the US is tens of a cent.
Likewise for mailpiece weight, the column is defined as an INTEGER.. The
rules table will say, that in the US, the units are tens of an ounce, etc.
This method works great on several different levels.
- Rounding "errors" are miniminzed.
- Internationalization is extremely easy, as a column could hold units
defined as, dollars, cents, tens of a cent, euro dollars, rands, ounces,
grams, pounds, hectares, square miles, yards, meters, millimeters, so on and
so forth.
Very easy, once the rules classes are implimented, and easily extendable.

Best regards,
Fred Wilson
SE, Böwe Bell & Howell

-----Original Message-----
From: Brian K. Woods [mailto:brian@...]
Sent: Thursday, February 20, 2003 12:06 PM
Subject: RE: [ib-support] newbie question : NUMERIC and DECIMAL type


> I'm using JayBird JDBC to access the tables, for financial calculation.
> It would be accessed into JDBC BigDecimal object.
> What would be the correct choice of data type ?

I have not worked with JDBC, so, someone else will have to inform you of
any issues concerning BigDecimal.
However, on the issue of which to use in general, I can only pass back
wisdom already imparted in this
forum on several occasions. Ann and/or Helen (I think Helen gives credit for
it to Ann) stated a rule of
thumb to use DECIMAL for things you "measure" and NUMERIC for things you
"count". I have adopted that
rule of thumb, and so far it has always worked out correctly in my financial
calculations, etc.

Since you "count" pennies, use NUMERIC for money. As an example, I have
taken to using NUMERIC(15,4),where
the 4 is because I use Delphi, which only uses four "cents" digits in its
currency calculations.

There are others with more experience than I who can correct me if I have
steered you wrong, esp.
pertaining to any issues with JDBC / BigDecimal.


To unsubscribe from this group, send an email to:

Your use of Yahoo! Groups is subject to

[Non-text portions of this message have been removed]