Page 1 of 1

Result of a division

Posted: Thu May 20, 2004 6:15 am
by Peytot
Hi everybody,

In my transform, I try to divise 2 fields :
A Number 9
B Number 9

My targer is C Decimal 5 scale 2

When I check the result, I never have the number after the comma. It always truncate the value.

For exemple:
A = 27
B = 5

C= 5.00 but the right value is 5.40

How can I revolve that?
If you have the answer I will be very interesting.

Thank for your help

Pey

Posted: Thu May 20, 2004 4:03 pm
by ray.wurlod
What are the data types of A and B?

Posted: Fri May 21, 2004 8:35 am
by Peytot
A and B are Numbers with lenght 9

Posted: Fri May 21, 2004 5:29 pm
by ray.wurlod
Is the scale for A and B set to 0? This might (I'm guessing) affect the scale of the result of the division. If so, this could be a bug.

Posted: Sun Aug 22, 2004 7:58 pm
by dsxnewbie
Hi All!


I am also experiencing the same problem whenever I perform any form of arithmetic operation on my numeric data :? . I am using the metadata of the table as I have imported into the table definition. I have several columns defined as NUMBER type hence it's defaulted to DECIMAL(38,0) in the OCI stage.

I was able to do a workaround :D with it in the transformer stage using the string arithmetic operation (SDIV, SMUL). This way I was able to get the decimal place values. However, I need to do aggregation and thus my problem began. There is not much I can do about the aggregator stage thus I am now seeking help :cry: on what approach to take.

I would really appreciate any suggestions. Thanks!


Juvin