• <Helps for GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • CSPro Statements and Functions
      • Statement Format Symbols
      • Alphabetical List of Functions and Statements
      • List of Reserved Words
      • Deprecated Features
      • Declaration Statements
      • Array Object
      • Audio Object
      • Barcode and QR Codes
      • Document Object
      • File Object
      • Freq Object
      • Geometry Object
      • HashMap Object
      • Image Object
      • List Object
      • Map Object
      • Path
      • Pff Object
      • SystemApp Object
      • ValueSet Object
      • Program Control Statements
      • Assignment Statements
      • Data Entry Statements and Functions
      • Batch Edit Statements
      • Numeric Functions
      • String Functions
        • Compare Function
        • Concat Function
        • String Concatenation Operator
        • Edit Function
        • GetBuffer Function
        • Length Function
        • MakeText Function
        • Message Formatting Options
        • Pos Function
        • PosChar Function
        • RegExMatch Function
        • Replace Function
        • StartsWith Function
        • Strip Function
        • ToLower Function
        • ToNumber Function
        • ToUpper Function
      • Multiple Occurrence Functions
      • General Functions
      • Date and Time Functions
      • External File Functions
      • Synchronization Functions
      • Export Attributes
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Appendix
  • <Helps for CSEntry>
  • <Helps for CSBatch>
  • <Helps for CSTab>
  • <Helps for DataViewer>
  • <Helps for TextView>
  • <Helps for TblView>
  • <Helps for TRSWin>
  • <Helps for CSDeploy>
  • <Helps for CSPack>
  • <Helps for CSFreq>
  • <Helps for CSSort>
  • <Helps for CSExport>
  • <Helps for CSReFmt>
  • <Helps for CSDiff>
  • <Helps for CSConcat>
  • <Helps for TRSSetup>
  • <Helps for ParadataViewer>
  • <Helps for ParadataConcat>
  • <Helps for CSIndex>
  • <Helps for Excel2CSPro>
  • <Helps for CSWeb>

Edit Function

 

Format:

s = edit(edit-pattern,numeric-expression);

 

Description:

The edit function converts a number to a character string defined by the given "edit pattern". The "edit pattern" is a string containing "Z"s or "9"s (i.e., "9999" or "ZZ9.99"). Both "9" and "Z" represent a digit.

 

 9  display a digit

 Z  display a digit, but if it is a leading zero, display a blank

 .  display the decimal character

 , display the thousands separator character

 

Any other character will be displayed as itself.

 

Return value:

The function returns a string derived from the "numeric-expression" argument.

 

Example 1:

X = 87;

A1 = edit("ZZZ9",X); yields A1 = " 87"

A2 = edit("9999",X); yields A2 = "0087"

A3 = edit("Z999",X); yields A3 = " 087"

 

Example 2:

Y = 0;

A4 = edit("ZZ9",Y); yields A4 = " 0"

A5 = edit("999",Y); yields A5 = "000"

A6 = edit("ZZZ",Y); yields A6 = " "

 

Example 3:

A = edit("99:99:99",sysdate());

 

Example 4:

A = edit("99/99/99",sysdate("DDMMYY"));

 

Example 5:

A = edit("ZZZ,ZZZ,ZZ9",INCOME);

 

See also: Tonumber Function , Sysdate Function