Character to convert in decimal

Post Reply
Armin Thurner
Posts: 3
Joined: Fri Jun 08, 2007 12:32 pm

Character to convert in decimal

Post by Armin Thurner »

Hi Antonio,
I have a big problem to convert a character field n5 char(20,0) to a dezimal field betrag(N,12,2)
I get the characterfield with csv conversion from bank.
-23,58 field n5
or
+11.931,76 field n5
with the code
betrag = val(n5)
the result is
-23.00 and not -23.58 or -23,58
the problem is, that there are no decimals.
Please can you give me here some examples for conversion.
Thank you
Best regards Armin
Thanks Armin
User avatar
alerchster
Posts: 31
Joined: Mon Oct 22, 2012 4:43 pm

Re: Character to convert in decimal

Post by alerchster »

Code: Select all

  betrag = val(strtran(strtran(n5,".",""),",","." ))
Regards

Ing. Anton Lerchster
Armin Thurner
Posts: 3
Joined: Fri Jun 08, 2007 12:32 pm

Re: Character to convert in decimal

Post by Armin Thurner »

Vielen lieben Dank.
Es funktioniert ausgezeichnet.
Bin auch Kärntner vom Gailtal Presseggersee.
Bin nächste Woche in Kärnten, darf ich Sie auf ein Dinner einladen?
arminthurner@gmx.at
www.i-pointpartner.net
+436801263158
Liebe Gruesse
Armin Thurner
Thanks Armin
Post Reply