[Robelle-l] Re: Répondre: RE: [Robelle-l] Calling all keeners

Neil Armstrong neil@robelle.com
Tue, 15 Apr 2003 07:39:25 -0400


At 08:00 AM 4/15/2003 +0000, Kurt Sager wrote:
Dear Kurt,

See my answers below.

>      >set decimalsymbol "."
>      >set thousandsymbol ","
>      >set currencysymbol "$"
>
>1. set commands
>
>can we do a
>set currencysymbol "CHF"
>(several characters) ?

No. Do numbers from spreadsheets and other Electronic formats
look like this. How would this appear. Please give a real world
example. The workaround would be to define the field excluding
the CHF.



>can we
>set decimalsymbol ","
>(decimal point is a comma, usual notation in Germany for example!)
>and this will overwrite the rule of stripping out any commas ???

Yes. This is why the set commands are in there. You would
have to do :

set decimalsymbol ","
set thousandsymbol "."




>2. rounding
>
>Please note that in our country (of banks ...) the generally applied
>rounding rule says:
>- if the last digit to be rounded is a 5, then it is
>     rounded DOWN if the preceeding figures is EVEN
>     rounded UP if the preceeding figure is ODD
>Examples:
>          1.245 --> 1.24
>          1.235 --> 1.24
>total   2.480 --> 2.48
>In fact, this rule avoids introducing a bias when a large number of
>numbers have
>to be rounded and then added to give a total.
>If not everybody is happy with my rounding proposal then you might consider
>a new
>
>set swissroundingrule on      ;-)

Mathematically that is not rounding. :) I will have to
see how this would fit in, but it would most certainly
have to be a set option. It might not be in the next
release either.


>3. Diskussion about what to do with the  "space character"
>
>Why not changing, optionally, occuring spaces to a comma (thousand 
>separator) ?
>
>You might consider a more general command
>
>set characterreplace "<cb(1)><cb(2)> ... <cb(n)>"<ca(1)><ca(2)>...<ca(n)>"

I already solved the space issue.


>where
>   cb(i) and ca(i) are single charaters
>   cb(i) := character before replacement
>   ca(i) := character after replacement
>and this setting will
>   cb(i) --> ca(i) for i = 1, ..., n  (execution strictly in this order)
>for all characters matching a cb(i) within the field to be treated,
>leaving non-matching
>characters unchanged.
>
>Easier to implement would probably be
>
>set keepspecialcharacters "."
>which would remove (before the type conversion) all characters expect the
>decimal point (and the figures 0 to 9 of course).

You forgot overpunch characters as well. :)

I will look at the "swissrounding" rule issue today.

Sincerely,


Neil Armstrong
Robelle



>Kurt
>
>
>  "'robelle-l@robelle.com'" <robelle-l@robelle.com
>
>Le Mon, 14 Apr 2003 12:27:35 -0400, Neil Armstrong a écrit:
>
> > At 12:15 PM 4/14/2003 -0400, Pickering, John (NORBORD) wrote:
> > John,
> >
> > Actually I briefly mention it in the last paragraph, as it
> > is the ThousandSymbol. A comma is essentially just stripped
> > from the number. Same is true for the currency symbol. They
> > are settable for other Currencies/formats etc. The only issue is that
> > you cannot have spaces in-between numbers. Part of this
> > trial is to see if that particular edit should be removed. It was
> > mentioned to me, as a possible issue but I have to see the
> > response and find the best solution based on that response.
> >
> > The concern was to provide the types of edits, where someone
> > is trying to define a field and they miscount and end up with
> > a number that looks like:
> >
> > 12345 1
> >
> > where the 1 is the start of the next field.
> >
> > I can certainly either consider spaces be an error or not,
> > or I can make it an option. Keep in mind that the more options
> > you add the slower this function may be.
> >
> > The comma is simply stripped as there are no numeric data types
> > that consider it a "legal" character. The function is called
> > $number as it takes a certain defined space and tries to convert
> > it to a number.
> >
> > Thanks for the great feedback. It is all stuff that I have thought
> > of, but need feedback on.
> >
> > Sincerely,
> >
> >
> > Neil Armstrong
> > Robelle
> >
> > >Neil
> > >
> > >You don't say anything about commas. Will the function accept commas
> > -- e.g.
> > >123,456.99 ?
> > >
> > >You might consider an enhancement to ignore commas (simply toss them
> > away)
> > >-- I get a lot of data from Excel and the users keep forgetting to=
 remove
> > >all the pretty formatting stuff so my Powerhouse conversion routines
> > choke
> > >since they don't like commas.
> > >
> > >And then the Quebec users are going to want to use spaces instead of
> > commas
> > >and commas instead of periods -- some sort of SI standard I think,
> > or maybe
> > >they're just exerting their usual "distinct" differences. Maybe=
 European
> > >customers will ask for something similar?
> > >
> > >Sorry if I've opened a can of worms :-)
> > >
> > >Regards,
> > >JWP
> > >
> > >
> > >-----Original Message-----
> > >From: Neil Armstrong [mailto:neil@robelle.com]
> > >Sent: Monday, April 14, 2003 11:47 AM
> > >To: robelle-l@robelle.com
> > >Subject: [Robelle-l] Calling all keeners
> > >
> > >
> > >Dear Robelle-L,
> > >
> > >We just finished a very interesting enhancement to
> > >Suprtool, which we want some keen people to test for
> > >us.
> > >
> > >The feature we want tested is a new function called
> > >$number, which will take a free-form "number" and
> > >use it as a display field.
> > >
> > >Here are the change notice docs to describe this
> > >feature. If you are interested in trying this
> > >feature out then please e-mail me back at neil@robelle.com.
> > >
> > >This is the last pre-release of Suprtool, prior to
> > >production release for Suprtool 4.7. Here are the draft docs
> > >for the new feature:
> > >
> > >$Number Function If and Extract
> > >
> > >Suprtool now has the ability  to  accept  free-form  "numbers"  as
> > >display data types.  This means number in the form:
> > >
> > >   1234.45-
> > >   -12345
> > >   -123.2134
> > >    12343
> > >    $123.45-
> > >
> > >can now be accepted and converted to any other numeric data type.
> > >
> > >Consider the following data:
> > >
> > >    Item-number    New-Price
> > >     12345          +123.45
> > >     34563          + 27.5
> > >     21312          +  1.545
> > >
> > >Suprtool  can now read and convert the data in New-Price using the
> > >number function.  Let's say we  want  New-Price  to  be  a  double
> > >integer  and  currently  occupies eight bytes starting in position
> > >six.
> > >
> > >Here  is  the  task  you  would  use  to  convert  the   New-Price
> > >free-format number into a double integer.
> > >
> > >    >in mynums
> > >    >def item-number,1,5,byte
> > >    >def new-price-ascii,6,8,display
> > >    >def new-price,1,4,double
> > >    >item new-price-ascii,dec,2
> > >    >item new-price,dec,2
> > >    >ext item-number
> > >    >ext new-price=$number(new-price-ascii)
> > >    >out somefile,link
> > >    >xeq
> > >
> > >
> > >The  $number  function  take  the free-format number and make it a
> > >valid display number.  It will determine the decimal, sign and add
> > >leading zeroes.  It will round the number to the defined number of
> > >decimal places.
> > >
> > >In the case of 1.545 number, Suprtool will round the value  to  be
> > >1.55,  since  the  given  number  of decimal places is two and the
> > >preceding value is five or greater.  If you have  a  whole  number
> > >such as 54, with no decimal point the value becomes 54.00.
> > >
> > >Suprtool will not accept data that has:
> > >
> > >     More than one sign.
> > >     More than one decimal place.
> > >     Spaces in between numbers.
> > >     Signs that are in between numbers.
> > >     Characters that are not over punch characters.
> > >     Fields that when edited do not fit in the defined space for the
> > >display field.
> > >
> > >You can control the character that defines the currency,  thousand
> > >and  decimal  symbol  for  other  currencies and formats using the
> > >following commands:
> > >
> > >     >set decimalsymbol "."
> > >     >set thousandsymbol ","
> > >     >set currencysymbol "$"
> > >
> > >Suprtool in the above case will strip the  currency  and  thousand
> > >symbols  and  use  the  decimal  symbol to determine the number of
> > >decimal places.  You can set these characters to  any  values  you
> > >want but the defaults for each are used in the above set commands.
> > >
> > >Sincerely,
> > >
> > >
> > >Neil Armstrong
> > >Suprtool Architect
> >
> >
> > _______________________________________________
> > Robelle-l mailing list
> > Robelle-l@robelle.com
> > http://two.pairlist.net/mailman/listinfo/robelle-l
> >
>
>
>
>Mit freundlichem Gruss
>Meilleures salutations
>Best regards
>
>Kurt Sager
>CEO
>---------------------------------------------------------------------------=
-----------
>Kurt Sager
>SWS SoftWare Systems AG, av. de la Gare 7, C.P. 1413, CH-1701 Fribourg
>SWS SoftWare Systsms GmbH, Traubengasse 19, DE-79552 Weil am Rhein
>http://www.sws.ch
>Phone: +4126 321 2942   Fax: +4126 321 2926
>Support & Hotline: support@sws.ch
>Product Infos      : info@sws.ch
>---------------------------------------------------------------------------=
-----------
>
>
>
>_______________________________________________
>Robelle-l mailing list
>Robelle-l@robelle.com
>http://two.pairlist.net/mailman/listinfo/robelle-l