Page 1 of 1

Character to convert in decimal

Posted: Fri Oct 09, 2015 11:14 am
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

Re: Character to convert in decimal

Posted: Fri Oct 09, 2015 11:48 am
by alerchster

Code: Select all

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

Re: Character to convert in decimal

Posted: Fri Oct 09, 2015 2:19 pm
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