Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I found the error below when trying to use the expression, Float.parseFloat(StringHandling.EREPLACE(row7.Amount_Billed_April,",","")) in tmap.
Exception in component tMap_6 (Sync_KEdata_from_XL_to_SQL_Server)
java.lang.NumberFormatException: empty String
at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
at sun.misc.FloatingDecimal.parseFloat(Unknown Source)
at java.lang.Float.parseFloat(Unknown Source)
at local_project.sync_kedata_from_xl_to_sql_server_0_1.Sync_KEdata_from_XL_to_SQL_Server.tFileInputDelimited_6Process(Sync_KEdata_from_XL_to_SQL_Server.java:1343)
at local_project.sync_kedata_from_xl_to_sql_server_0_1.Sync_KEdata_from_XL_to_SQL_Server.runJobInTOS(Sync_KEdata_from_XL_to_SQL_Server.java:1969)
at local_project.sync_kedata_from_xl_to_sql_server_0_1.Sync_KEdata_from_XL_to_SQL_Server.main(Sync_KEdata_from_XL_to_SQL_Server.java:1817)
How do I replace the empty string with "0.0" so that this exception can be handled?
Hi
Try this expression
row7.Amount_Billed_April.equals("")?0.0f:Float.valueOf(row7.Amount_Billed_April)
Regards
Shong