Float.parseFloat, Type mismatch: cannot convert from String to Float

One Star

Float.parseFloat, Type mismatch: cannot convert from String to Float

Dear all,
I try to cast from string to float.
I use java code in a tJavaFlex component : 
row2.coord = Float.parseFloat(row1.coord);

Of course, I select the right type for input (string) and output(float)
But i have an error : 
Type mismatch: cannot convert from String to Float

Thank you in advance for your idea!
Nine Stars JR
Nine Stars

Re: Float.parseFloat, Type mismatch: cannot convert from String to Float

I suggest to use the tConvertType component instead of diving into custom Java coding. Its use is pretty straightforward and it does what you desire.
Forteen Stars

Re: Float.parseFloat, Type mismatch: cannot convert from String to Float

use 
Float.valueOf(row1.coord)
-----------

2019 GARNER 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

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Downloads and Trials

Test drive Talend's enterprise products.

Downloads