Decimal , string ....

Dear all,

I am reading a file with amounts , fixed format 

0001321311145
4564646431231
1113123131311

i have to read the values (no problem) and then convert them to a decimal 
variable with 2 decimals behind the comma.

so 

   13213111,45
45646464312,31
11131231313,11

I am not sure how to convert the string value (13 long) to a dec(11,2) 

TIA
John
0
John
1/31/2002 3:08:55 PM
sybase.powerbuilder.general 62418 articles. 17 followers. Follow

3 Replies
365 Views

Similar Articles

[PageSpeed] 12

Dec(stringvar)/100

--

Simon Caldwell
Get Real Systems Ltd
Holtby Manor, Stamford Bridge Road, York, YO19 5LL
Tel +44 (0)1904 481999 Fax +44 (0)1904 481666
Visit us at www.getrealsystems.com
Procurement Control Specialists
Controlling corporate spend and streamlining procurement processes


<''John''> wrote in message
news:9AC4E427BC81B71C005336A285256B52.005336C285256B52@webforums...
> Dear all,
>
> I am reading a file with amounts , fixed format
>
> 0001321311145
> 4564646431231
> 1113123131311
>
> i have to read the values (no problem) and then convert them to a decimal
> variable with 2 decimals behind the comma.
>
> so
>
>    13213111,45
> 45646464312,31
> 11131231313,11
>
> I am not sure how to convert the string value (13 long) to a dec(11,2)
>
> TIA
> John


0
Simon
1/31/2002 3:32:51 PM
ld_value = dec (ls_value) / 100

??


<''John''> wrote in message
news:9AC4E427BC81B71C005336A285256B52.005336C285256B52@webforums...
> Dear all,
>
> I am reading a file with amounts , fixed format
>
> 0001321311145
> 4564646431231
> 1113123131311
>
> i have to read the values (no problem) and then convert them to a decimal
> variable with 2 decimals behind the comma.
>
> so
>
>    13213111,45
> 45646464312,31
> 11131231313,11
>
> I am not sure how to convert the string value (13 long) to a dec(11,2)
>
> TIA
> John


0
Bug
1/31/2002 3:38:14 PM
Double() accepts string and works to 15 digits of precision.

Double( ls_number ) / 100 // Works but won't force trailing zero

Round( Double( ls_number ) / 100, 2 ) // Forces trailing zero

-HTH

-EGM

<''John''> wrote in message
news:9AC4E427BC81B71C005336A285256B52.005336C285256B52@webforums...
> Dear all,
>
> I am reading a file with amounts , fixed format
>
> 0001321311145
> 4564646431231
> 1113123131311
>
> i have to read the values (no problem) and then convert them to a decimal
> variable with 2 decimals behind the comma.
>
> so
>
>    13213111,45
> 45646464312,31
> 11131231313,11
>
> I am not sure how to convert the string value (13 long) to a dec(11,2)
>
> TIA
> John


0
Edward
2/1/2002 3:11:11 PM
Reply: