Page 1 of 1

Integer division by integer problem

Posted: Mon Dec 21, 2009 2:52 pm
by somu_june
Hi,

I'm trying to divide two integer numbers num1 and num2 in transformer and their values are 285363/362089 and the result is 0.78810 and I'm trying to write this to a output field out1 decimal(5,2) but I'm getting a value of 000.00 instead of 000.78.


I searched the form on how/why floating point numbers can not be stored to full accuracy in computers. But no luck.


Can some body tell me how to get the actual decimal value instead of 0 value.



Thanks,
Raju

Posted: Mon Dec 21, 2009 4:25 pm
by ray.wurlod
What happens if you convert each to Decimal first? Use DecimalToDecimal() function.

Posted: Tue Dec 22, 2009 2:34 pm
by somu_june
Thanks Ray it is working now after I changed it to decimal as you said