Page 1 of 1

StringToDecimal

Posted: Mon Sep 05, 2005 7:18 pm
by benny.lbs
I have a report in following format

Code: Select all

12345678901234567890
--------------------
          23,030.12-
The negative sign is in the trailing position and there is comma inside the string, I would like to know what 's the best solution to convert this string into Decimal

Thanks in advance.

Posted: Mon Sep 05, 2005 8:27 pm
by ray.wurlod
Assuming that the data type is a string of some kind, a buildop to remove the thousands delimiter(s), detect the sign and move it to the front of the string seems to be the way to go.

Posted: Mon Sep 05, 2005 11:55 pm
by rumu
ray.wurlod wrote:Assuming that the data type is a string of some kind, a buildop to remove the thousands delimiter(s), detect the sign and move it to the front of the string seems to be the way to go.
Hi,
I came across the same situation in my proj,wat i did exactly ruy suggest,moved the trailing -ve sign to prefix it ant trim ',' sign using stage varibles.

Posted: Tue Sep 06, 2005 8:31 am
by dsx_venkat
Even myself faced this problem, i choosed external routines (C routines)
and converted into parallel routines,