Edits

Kroboth, Joe joe_kroboth at chernay.com
Fri Sep 27 12:59:28 PDT 2013



>-----Original Message-----
>From: Kenneth Brody [mailto:kenbrody at spamcop.net] 
>Sent: Friday, September 27, 2013 1:01 PM
>To: Kroboth, Joe
>Cc: filepro-list at lists.celestial.com
>Subject: Re: Edits

>On 9/27/2013 12:51 PM, Kenneth Brody wrote:
> On 9/27/2013 12:20 PM, Kroboth, Joe wrote:
>> Anyone have an edit for the following they would like to share.
>>
>> Need to covert some numbers.
>>
>> Some examples
>>
>> 00000000021662+ to 216.62
>> 00000000758620- to -7586.20
>
> Test this:
>
>       kroboth  ( ({N}"-")&<->krob2 ) | ( ({N}"+")&krob2 )
>       krob2    { (N N N N & !0!) | ( N <.> N N (!-!|!+!) @ ) | N }

<Correction:

<         krob2    { (N N N N & !0!) } { ( N <.> N N (!-!|!+!) @ ) | N }

> This assumes:
>
>       There will always be a trailing "+" or "-".
>       You want to keep a single leading zero for values less than 1.00
>           For example:  000000000012+  -->  0.12
>
> I leave the explanation as to how this works as an exercise to the reader.

>I also leave as an exercise the explanation as to what was wrong with the first version, and how the second version fixes it.

>Kenneth Brody


Thank Ken!  

filePro edits still amaze me.  


Joe


More information about the Filepro-list mailing list