[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: SQR Question about number formatting routine (number.sqc)



Steve...
You are using it right and the sqc works.  Most of the time, I just use an SQR 
edit mask instead of the sqc.
Sam

<<< Steve Bergin <Steve.Bergin@KAISERAL.COM>  4/14 11:29a >>>
Environment:
   HRizon 7.01b
   Centura SQLBase 6.1.2 PTF-4 on NT 4.0
   SQR  3.x

When I call the number formatting routine like this:
      do format-number(#in, $out, '99,999.99')

  I expect to get a number formatted like 99,999.99
  but instead get a number formatted like 9999999

When I format the number like this
      move #in to $out '99,999.99'

   I get the desired result.


The statements executed in number.sqc are:

     begin-procedure Format-Number(#in, :$out, $mask)

          move #in to $out :$mask
          let $out = translate($out,',.',$_Delimiters)

     end-procedure


I have two questions:

1.  Am I using number.sqc properly and getting a bad result
or do I misunderstand the purpose of the routine.

2.  Is ":$mask" correct or should it be "$mask" in the move
 statement in the routine?

Just learning.

Thanks for your help.