Subject | Numeric field used to store currency value |
---|---|
Author | equator9 |
Post date | 2002-02-11T23:46:52Z |
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
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