CoCoA:Format

From ApCoCoAWiki
Revision as of 10:02, 24 October 2007 by XMLBot (talk | contribs) (pushing XML rev. 1.46, again)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Format

convert object to formatted string

Description

Like Sprint, this function converts the value of E into a string. If

the string has fewer than N characters, then spaces are added to the

front to make the length N.

Example

  L := [1,2,3];
  M := Format(L,20);
  M;
           [1, 2, 3]
-------------------------------
  Type(L);
LIST
-------------------------------
  Type(M);
STRING
-------------------------------
  Format(L,2);  -- <quotes>Format</quotes> does not truncate
[1, 2, 3]
-------------------------------

Syntax

Format(E:OBJECT,N:INT):STRING

IO.SprintTrunc

Latex

Sprint

   <type>io</type>
   <type>printing</type>
   <type>string</type>