I need my result of a division to ROUND DOWN not ROUND UP. In dividing 2 fields I need to truncate the decimal place to 7 positions to Round Down no Round Up. I have tried adding the Environment Variable $APT_DECIMAL_INTERM_SCALE for Integer Type and defaulting the scale to 7 and then doing the following calculation, but it doesn't work. I have looked thru the forum and if I understand correctly this should have truncated to 7 position without rounding. Is that correct and if so it doesn't work. Can you provide any guidance as to what I may be doing wrong?
DecimalToDecimal(00000285407.48 / 0498047217.84,"TRUNC_ZERO")
result received
00000.0005731
result needed
00000.0005730
Thank You in advance.
Trunc Decimals in Division
Moderators: chulett, rschirm, roy
Use DecimalToDecimal(00000285407.48 / 0498047217.84,"TRUNC_ZERO") and set the scale of the target decimal to 7 without changing other default settings on the environment variables, especially not $APT_DECIMAL_INTERM_SCALE, because setting it to 7 causes DataStage to round before the actual DecimalToDecimal-Conversion takes effect.
"It is not the lucky ones are grateful.
There are the grateful those are happy." Francis Bacon
There are the grateful those are happy." Francis Bacon