Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] Convert a String to Long

I setting a variable as
Long.parseLong(row1.precio.trim())
but released the following exception...
Exception in component tMap_1
java.lang.NumberFormatException: For input string: "100.00"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Long.parseLong(Unknown Source)
at java.lang.Long.parseLong(Unknown Source)
at tabd.importprices_0_1.ImportPrices.tFileInputExcel_1Process(ImportPrices.java:934)
at tabd.importprices_0_1.ImportPrices.runJobInTOS(ImportPrices.java:1286)
at tabd.importprices_0_1.ImportPrices.main(ImportPrices.java:1195)
OS: Win XP SP3
TOS: 3.1.3
Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hello
You should substring the string if there is a period? for example:
row1.precio.contains(".")?row1.precio.substring(0,row1.precio.indexOf("."):row1.precio
Best regards
Shong

View solution in original post

2 Replies
Anonymous
Not applicable
Author

Hello
You should substring the string if there is a period? for example:
row1.precio.contains(".")?row1.precio.substring(0,row1.precio.indexOf("."):row1.precio
Best regards
Shong
Anonymous
Not applicable
Author

It´s working.
Thank you