Edits

Kenneth Brody kenbrody at spamcop.net
Fri Sep 27 10:01:20 PDT 2013


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


More information about the Filepro-list mailing list