Subject | RE: [ib-support] Numeric field used to store currency value |
---|---|
Author | Richard Pendered |
Post date | 2002-02-12T09:00:12Z |
John,
Regardless of the RDBMS I use, I always use NUMERIC(18,0) or INTEGER to
store currency values as pence (in the case of ?) or cents ($) etc. I know
that this is not very multi currency, but it is the simplest way round the
rounding problems that you are having (well that I know of anyway !!)
Rich P...
-----Original Message-----
From: equator9 [mailto:john@...]
Sent: 11 February 2002 23:47
To: ib-support@yahoogroups.com
Subject: [ib-support] Numeric field used to store currency value
Hi All,
If some one could help I would greatly appreciate it.
I am using Interbase 6.0.1.6
I have fields in several tables that I use to store currency values
defined as Numeric 15 2
I have found several entries are listed like this 12.328
I would have thought that defining the field as N 15 2 would not
allow the value to be stored to 3 decimal places.
I now need to change all the table entries to 3 significant places.
(My code checks if an invoice has been paid or if there is anything
outstanding i.e equals 0.00 - my users are entering 12.33 but my code
does not allow the invoice to be cleared)
Two Questions:
1. How can I ensure this does not happen again?
2. What sql / script can I use to adjust / round to 2 decimal places
these values?
TIA,
John Newcombe
To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Regardless of the RDBMS I use, I always use NUMERIC(18,0) or INTEGER to
store currency values as pence (in the case of ?) or cents ($) etc. I know
that this is not very multi currency, but it is the simplest way round the
rounding problems that you are having (well that I know of anyway !!)
Rich P...
-----Original Message-----
From: equator9 [mailto:john@...]
Sent: 11 February 2002 23:47
To: ib-support@yahoogroups.com
Subject: [ib-support] Numeric field used to store currency value
Hi All,
If some one could help I would greatly appreciate it.
I am using Interbase 6.0.1.6
I have fields in several tables that I use to store currency values
defined as Numeric 15 2
I have found several entries are listed like this 12.328
I would have thought that defining the field as N 15 2 would not
allow the value to be stored to 3 decimal places.
I now need to change all the table entries to 3 significant places.
(My code checks if an invoice has been paid or if there is anything
outstanding i.e equals 0.00 - my users are entering 12.33 but my code
does not allow the invoice to be cleared)
Two Questions:
1. How can I ensure this does not happen again?
2. What sql / script can I use to adjust / round to 2 decimal places
these values?
TIA,
John Newcombe
To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/