Numeric.convertImpliedDecimalFormat

One Star

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
Moderator

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
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

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
Moderator

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 TalendHelpCenter:tConvertType.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog