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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

convert decimal (comma to dot) postgres

Hi guys
It's me ... again !!! 0683p000009MACJ.png
Here is an example of my file
_________________________
15;2013;25/02/1998;3;999;1; 1003,49
15;2105;25/02/1998;3;999;1; 1003,49
...
Well I want to convert decimal text column to floating point Postgres Column.
when i try to do that i've got an cute error message 0683p000009MPcz.png
_________________________________________________________________
tarting job job_2 at 18:17 04/07/2007.
connecting to socket on port 3334
connected
Exception in component tFileInputDelimited_1
java.lang.NumberFormatException: For input string: " 1003,49"
at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
at java.lang.Float.parseFloat(Unknown Source)
at routines.system.ParserUtils.parseTo_float(ParserUtils.java:50)
at projet_1.job_2.job_2.tFileInputDelimited_1Process(job_2.java:296)
at projet_1.job_2.job_2.main(job_2.java:536)
disconnected
Job job_2 ended at 18:18 04/07/2007.
My question ...
Is there an numeric pattern or an other trick to convert my column ?
like that 1003,49 to 1003.49
THX
Regards ...
Didier
_____________________
Under Windows XP
TOS:v2.1.0.M1_r3483
Oracle 10g
Postgres 8.2.3
jre 1.6

_________________________________________________________________
Labels (3)
10 Replies
Anonymous
Not applicable
Author

Hello
Problem is that , is not the decimal separator in Java.
You have to read your fields as a String.
Then you can parse it and convert it as a Float in a tMap : new Float(row.fieldName.replace(',', '.'))
Regards,
Anonymous
Not applicable
Author

hi 0683p000009MA9p.png
oki I try and i keep you informed
i saw the hour of your answer ... lol go to sleep !!! 0683p000009MACJ.png
thx a lot
Regards
Anonymous
Not applicable
Author

Hi ...
it work !
Thaaaaaaaanks 0683p000009MACJ.png
Have fun 0683p000009MA9p.png
Regards !
_AnonymousUser
Specialist III
Specialist III

Hello Didier,
I'm facing the same trouble as you did : wanna change decimal separator ',' by '.' from string to float.
I've tried to use a tMap Component with this piece of code :new
Float(row.fieldName.replace(',', '.'))
It fails... Where should I write this expression ?
I'm new to Talend so it would be very kind to help me.
Anonymous
Not applicable
Author

Hi matthieu
See 1846.
Best regards
shong
_AnonymousUser
Specialist III
Specialist III

Hello
Problem is that , is not the decimal separator in Java.
You have to read your fields as a String.
Then you can parse it and convert it as a Float in a tMap : new Float(row.fieldName.replace(',', '.'))
Regards,

This my problem Thank you very muchhhh... 0683p000009MACn.png))
Anonymous
Not applicable
Author

in tfileinputdelimited you can set in advanced option custom decimal separaton, so custom coding not needed
bye
_AnonymousUser
Specialist III
Specialist III

Hi guys
It's me ... again !!! 0683p000009MACJ.png
Here is an example of my file
_________________________
15;2013;25/02/1998;3;999;1;1003,49
15;2105;25/02/1998;3;999;1;1003,49
...
Well I want to convert decimal text column to floating point Postgres Column.
when i try to do that i've got an cute error message 0683p000009MPcz.png
_________________________________________________________________
tarting job job_2 at 18:17 04/07/2007.
connecting to socket on port 3334
connected
Exception in component tFileInputDelimited_1
java.lang.NumberFormatException: For input string: "1003,49"
at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
at java.lang.Float.parseFloat(Unknown Source)
at routines.system.ParserUtils.parseTo_float(ParserUtils.java:50)
at projet_1.job_2.job_2.tFileInputDelimited_1Process(job_2.java:296)
at projet_1.job_2.job_2.main(job_2.java:536)
disconnected
Job job_2 ended at 18:18 04/07/2007.
My question ...
Is there an numeric pattern or an other trick to convert my column ?
like that 1003,49 to 1003.49
THX
Regards ...
Didier
_____________________
Under Windows XP
TOS:v2.1.0.M1_r3483
Oracle 10g
Postgres 8.2.3
jre 1.6

_________________________________________________________________

Problem is that , is not the decimal separator in Java.
You have to read your fields as a String.
-----------------------------------------------------------------------
tuyen dung | viec lam | tim viec
_AnonymousUser
Specialist III
Specialist III

Hi guys
It's me ... again !!! 0683p000009MACJ.png
Here is an example of my file
_________________________
15;2013;25/02/1998;3;999;1;1003,49
15;2105;25/02/1998;3;999;1;1003,49
...
Well I want to convert decimal text column to floating point Postgres Column.
when i try to do that i've got an cute error message 0683p000009MPcz.png
_________________________________________________________________
tarting job job_2 at 18:17 04/07/2007.
connecting to socket on port 3334
connected
Exception in component tFileInputDelimited_1
java.lang.NumberFormatException: For input string: "1003,49"
at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
at java.lang.Float.parseFloat(Unknown Source)
at routines.system.ParserUtils.parseTo_float(ParserUtils.java:50)
at projet_1.job_2.job_2.tFileInputDelimited_1Process(job_2.java:296)
at projet_1.job_2.job_2.main(job_2.java:536)
disconnected
Job job_2 ended at 18:18 04/07/2007.
My question ...
Is there an numeric pattern or an other trick to convert my column ?
like that 1003,49 to 1003.49
THX
Regards ...
Didier
_____________________
Under Windows XP
TOS:v2.1.0.M1_r3483
Oracle 10g
Postgres 8.2.3
jre 1.6

_________________________________________________________________

Problem is that , is not the decimal separator in Java.
You have to read your fields as a String.
-----------------------------------------------------------------------
tuyen dung | viec lam | tim viec