Quiz time -- "euronum" edit
Lerebours, Jose
Jose.Lerebours at EagleGL.com
Tue Aug 16 12:23:03 PDT 2005
Ken challenged:
>
> Quiz time! (I hope everyone studied.)
>
> I recently posted the following edit:
>
> euronum \ N N N euron2 | N N euron2 | N euron2
> euron2 [{ <.> N N N }] ( <,00> @ | "," NUM NUM )
>
> This takes numbers and puts them in the European style, where digits
> are separated by periods and the decimal is a comma. For example:
>
> 123.456.789,01
>
> My questions to you are:
>
> Why wouldn't the following, simpler, edit work?
>
> euronum \ N N N euron2 | N N euron2 | N euron2
> euron2 [{ <.> N N N }] <,> NUM NUM
>
> And, how does the "corrected" version above fix the problem?
>
The simpler edit will only work in even pairs so,
12345,12 will fail but 123456,12 will pass
Further more, if you tried 1234512 it pairs up
123.451 as the digits and pushes 2 as fraction
thus returning 123.451,20
The right edit makes no assumption to pair up the numbers
and it "DOES" add ,00 if whole number is entered instead
of pushing remaining after pairing ...
I think I know what I want to say but as usual, I just do not
know how. :-)
Regards;
Jose Lerebours
More information about the Filepro-list
mailing list