tXMLMap Expression Help

Highlighted
One Star

tXMLMap Expression Help

Hi,
this is my input : Mont = 129483948 ( type of Mont is string)
in my out put i need to have this : res =1294839,48 ( type of is BigDecimal )
Thank you for your help.
Sixteen Stars

Re: tXMLMap Expression Help

In your output (I will call it the "RES" column) you need the following. I am assuming the input row is "row1" and the input column is "MONT"...
row1.MONT!=null ? new BigDecimal(row1.MONT) : null

This checks to see that the MONT value is not null and then converts it to a BigDecimal if it is not null. If it is null, it just sets the output column to null.
One Star

Re: tXMLMap Expression Help

Thank you for your response, but me i retrive the input from a xsd scheme like this :

So how to do it ?
One Star

Re: tXMLMap Expression Help

after adding your expression i get this error :
Sixteen Stars

Re: tXMLMap Expression Help

It looks like you have a non numeric value in your number (maybe a monetary unit?) or the value is an empty string. If it is the non numeric unit, you will need to remove it. If it is an empty string, you need to filter those from being processed.
For example....
row1.MONT!=null && row1.MONT.trim().compareToIgnoreCase("")!=0 ? new BigDecimal(row1.MONT) : null
One Star

Re: tXMLMap Expression Help

Thank you it works.
Regards