If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Pls....solve difference 1 cent problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-26-04, 14:44
kennethlam kennethlam is offline
Registered User
 
Join Date: Jan 2004
Location: kuala lumpur
Posts: 18
Angry Pls....solve difference 1 cent problem

now our company system have face some problem that is diference 1 cent problem for the total inerest amount before the payment and after the payment. This is because the total interest amount is the sum value for 2 type of interest that are fixed interest and ongoing interest. This two type of interest also calulate by difference formula, this two type of value also use difference programs to calculate, but the variable use to store this 2 value is DECIMAL(13,2). The fixed interest is calculate by the program afer customer make the payment and the value will store in database, and than the ongoing interest is calculate by the program need to use this amount, but it does not store in database. Because this 2 value also store in DECIMAL(13,2) variable,So when this two value sum up together it also may not get the correct value.

For example.
---------------
BEFORE payment, the fixed interest can be 12.345678, but just the 12.35 value will store into database. The ongoing interest can be 33.5636891, after store into DECIMAL(13,2) variable it will become 33.56, and the total was 45.91.

AFTER payment, the fixed interes wil increase to 24.5647861, so 24.56 will store into database. The ongoing interest has become 21.3443892, so it will become 21.34. The total was 45.90.

----------BEFORE PAYMENT---------------
DECIMAL(13,2)
fix int : 12.345678 12.35
ong int: 33.5646891 33.56
------
total int: 45.91

----------AFTER PAYMENT---------------
DECIMAL(13,2)
fix int : 24.5647861 24.56
ong int: 21.3443892 21.34
-----
total int: 45.90

--------------------------------------
the fix interest is store into database so i cannot change that field variable to DECIMAL(21,10), because it will make other value wrong also.
i m still a training student, i wish have some one can help me solve this problem.

Thanks
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On