home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / pcmagazi / 1992 / 16 / parens.prg < prev    next >
Text File  |  1992-03-16  |  511b  |  13 lines

  1. ******************************************************************
  2. * FUNCTION parens
  3. * This function will place parenthesis around a negative number
  4. * No spaces will be displayed between the negative number
  5. * and the parenthesis (as they are if the @( format code is used).
  6. ******************************************************************
  7. FUNCTION parens
  8. PARAMETER number, pic
  9. RETURN IIF(number >= 0, ;
  10.  TRANSFORM(number, pic),;
  11.  PADL("("+ALLTRIM(TRANSFORM(ABS(number),pic))+")",LEN(pic)+1,' '))
  12.  
  13.