Decimal Question
Pickering, John (NORBORD)
PICKERIJ@norbord.com
Wed, 27 Feb 2002 13:33:30 -0500
Kathy (KKONEK@thecreek.com) correctly points out that this won't work when
the "cents" part of the results is a single digit.
So, one last (hopefully) time, I'll try again:
>define d-amount char*10 &
> = ascii(floor(amount of yourfile / 100)) + "." &
> + ascii(mod(abs(amount of yourfile),100),2)
Regards,
JWP
> -----Original Message-----
> From: Pickering, John (NORBORD)
> Sent: Wednesday, February 27, 2002 1:15 PM
> To: 'Jones Allen (Van)'; PowerHouse List (E-mail)
> Subject: RE: Decimal Question
>
> Correct.
>
> So I'll revise my suggestion to the following if there value can be
> negative:
>
> >define d-amount char*10 &
> > = ascii(floor(amount of yourfile / 100)) + "." &
> > + ascii(mod(abs(amount of yourfile),100))
>
> Regards,
> JWP
>
>
> -----Original Message-----
> From: Jones Allen (Van) [SMTP:Allen.Jones@vpgroup.com]
> Sent: Wednesday, February 27, 2002 1:04 PM
> To: PowerHouse List (E-mail)
> Subject: RE: Decimal Question
>
> Actually the ascii function returns the sign on the left, but you need to
> allow for it.
>
> -----Original Message-----
> From: Pickering, John (NORBORD) [mailto:PICKERIJ@norbord.com]
> Sent: Wednesday, February 27, 2002 9:56 AM
> To: PowerHouse List (E-mail)
> Cc: 'aarnone@grey.com'
> Subject: RE: Decimal Question
>
>
> Bob's answer will give you a right justified and zerofilled result.
>
> Here's one that gives a left justified unfilled result:
>
> >define d-amount char*10 &
> > = ascii(floor(amount of yourfile / 100)) + "." &
> > + ascii(mod (amount of yourfile , 100))
>
> Regards,
> JWP
>
>
> > -----Original Message-----
> > From: Edis, Bob [SMTP:BEdis@usbnc.org]
> > Sent: Wednesday, February 27, 2002 12:14 PM
> > To: PowerHouse List (E-mail)
> > Subject: RE: Decimal Question
> >
> > Use a float data type (d_famount FLOAT = iamount / 100) to convert value
> > to
> > an CHAR data type and insert the decimal point (e.g. d_camount CHAR*9 =
> > ASCII(iamount,8)[1:6] + '.' + ASCII(iamount,8)[7:2]
> >
> > Blue
> >
> > -----Original Message-----
> > From: Arnone, Anthony [mailto:aarnone@grey.com]
> > Sent: Wednesday, February 27, 2002 10:51 AM
> > To: powerh-l@lists.swau.edu
> > Subject: Decimal Question
> >
> >
> > I have a numeric field called amount that is stored in the database
> > without
> > the decimal placement. (i.e. $100.00 = 10000) I need to write this field
> > to
> > a subfile with the nodictionary parameter including the decimal point so
> > in
> > the file it looks like 100.00. Any Ideas? I am running 8.19 on MPE i/X.
> > Also
> > can someone explain when I append to a subfile with the nodictionary
> > parameter I need to hit the return key for it to process or else it
> would
> > do
> > nothing and just hang there.
> >
> > Anthony
> >
> >
>