Sunday, December 16, 2012

How to change a string to decimal with 2 decimal places in informatica?


Scenario:

How to change a string to decimal with 2 decimal places in informatica?


Eg:: input data 12345678

I want output as 123456.78

Solution:

output = to_decimal(to_integer(input)/100,2)

OR

SUBSTR(INPUT_FIELD, 1, LENGTH(INPUT_FIELD) - 2) || '.' || SUBSTR(INPUT_FIELD, -2)


1 comment:

Thank you :
- kareem