Formatting a number in PowerHouse - version 8.49.E
Peter Bateman
peterbateman808 at hotmail.com
Tue Sep 1 11:42:51 CDT 2009
Hi ALL:
I like Jay's solution. And I would add a matchpattern to make sure that the NCONVERT was getting the correct digits.
i.e. Define good_num = 1 if matchpattern ( zerofill (amount_string ), &
"(###!,###!,###!.##)|(0000###!,###!.##)|(00000000###!.##)"
Regards,
Peter
From: JNalder at ascprofiles.com
To: Chuck.J.Lowe at questdiagnostics.com; powerh-l at lists.sowder.com
Date: Mon, 31 Aug 2009 10:24:28 -0700
Subject: RE: Formatting a number in PowerHouse - version 8.49.E
Try right justifying it into a fixed length field and use subscripting
Define formatted-string char*14 = rj(pipe-delimited-field[1:14]) ; 999,999,999.00
Define amount-string char*14 = formatted-string[1:3] + formatted-string[5:3] + formatted-string[9:6]
Define amt float = nconvert( amount-string)
Jay Nalder.
From: powerh-l-bounces+jnalder=ascprofiles.com at lists.sowder.com [mailto:powerh-l-bounces+jnalder=ascprofiles.com at lists.sowder.com]
On Behalf Of Lowe, Chuck J
Sent: Monday, August 31, 2009 10:04 AM
To: powerh-l at lists.sowder.com
Subject: Formatting a number in PowerHouse - version 8.49.E
I have a file from an outside vendor. They are sending it pipe delimited "|", There is an amount field that is left justified. Is there anyway to take that character field
and convert it to a numeric field without doing INDEX and bit extracts. Sometimes the field is 123.45 and sometimes 3,123.45. I thought I could use the FORMATNUMBER function but that is for doing the opposite.
The vendor states they can not send it unformatted.
Thanks in advance.
Chuck Lowe
Quest Diagnostics
| Sr. Programmer/Analyst,SYS Billing System/Denver| 400 Egypt Rd. | West Norriton, PA 19403 USA |
phone 610-650-6679|
fax 610-650-2111 | Chuck.J.Lowe at questdiagnostics.com |
www.QuestDiagnostics.com
Please think about resource conservation before you print this message
------------------------------------------
The contents of this message, together with any attachments, are intended only for the use of the person(s) to which they are addressed and may contain confidential and/or privileged information. Further, any medical information herein is confidential and protected
by law. It is unlawful for unauthorized persons to use, review, copy, disclose, or disseminate confidential medical information. If you are not the intended recipient, immediately advise the sender and delete this message and any attachments. Any distribution,
or copying of this message, or any attachment, is prohibited.
NOTICE - This message and any attached files may contain information that is confidential, legally privileged or proprietary. It is intended only for use by the intended recipient. If you are not the intended recipient or the person responsible for delivering
the message to the intended recipient, be advised that you have received this message in error. Any dissemination, copying, use or re-transmission of this message or attachment, or the disclosure of any information therein, is strictly forbidden. BlueScope
Steel Limited does not represent or guarantee that this message or attachment is free of errors, virus or interference.
If you have received this message in error please notify the sender immediately and delete the message. Any views expressed in this email are not necessarily the views of BlueScope Steel Limited.
_________________________________________________________________
New! Get to Messenger faster: Sign-in here now!
http://go.microsoft.com/?linkid=9677407
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.sowder.com/pipermail/powerh-l/attachments/20090901/5fae3328/attachment.html
More information about the powerh-l
mailing list