• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » Numeric.convertImpliedDecimalFormat

#1 2013-12-23 14:25:56

Michael.Grenz
New member
Registered: 2013-11-29
Posts: 2

Numeric.convertImpliedDecimalFormat

Dear all,

I am trying to import data from a .txt file into a local DB.

The field "Price" is 11 chars long and is a float value without any delimiter char in the text file. E. g. possible value: "00000001500" stands for 15.00.

For data conversion I am using a tMap-Element with the conversion function: Numeric.convertImpliedDecimalFormat("999999999V99", row3.Price).

However following exception occurs: "Exception in component tMap_1, java.lang.NumberFormatException".

If I put the above value as a string constant into the function (Numeric.convertImpliedDecimalFormat("999999999V99", "00000001500")), the converting function works fine.

Thanks in advance

Offline

#2 2013-12-24 03:11:27

xdshi
Administrator
Registered: 2012-08-27
Posts: 5471

Re: Numeric.convertImpliedDecimalFormat

Hi,

There might be a error notification in java code for your exception" java.lang.NumberFormatException"(switch "Designer" mode to "Code").

Best regards
Sabrina


What we can do is to make sure that Talend will be your best choice!

Offline

#3 2013-12-27 14:03:02

Michael.Grenz
New member
Registered: 2013-11-29
Posts: 2

Re: Numeric.convertImpliedDecimalFormat

Hi Sabrina,

thank you for your response. I have verified the code, but do not see anything throwing an explicit Number.Format exception.

The code view of the tmap component is as following: "Dataconversion_tmp.Price = Numeric
                                        .convertImpliedDecimalFormat(
                                                "999999999V99", row3.Price);
                               
What do you mean with an "error notificaton"?


Kind regards,

Michael

Last edited by Michael.Grenz (2013-12-27 14:19:10)

Offline

#4 2013-12-30 03:44:25

xdshi
Administrator
Registered: 2012-08-27
Posts: 5471

Re: Numeric.convertImpliedDecimalFormat

Hi,

I supposed there would be any error line in java code.

I did use Numeric.convertImpliedDecimalFormat before. Is it working for your case when you use https://help.talend.com/display/TalendComponentsReferenceGuide54EN/tConvertType TalendHelpCenter:tConvertType[/url].

Best regards
Sabrina


What we can do is to make sure that Talend will be your best choice!

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » Numeric.convertImpliedDecimalFormat

Board footer

Powered by FluxBB