up previous next
SprintTrunc    --    convert to a string and truncate


Syntax
SprintTrunc(E: OBJECT, N: INT): STRING

Description
This function works like sprint , turning the value of the expression E into a string, but if the string has length greater than N-1, it is truncated and the string ... is concatenated. This function is useful in formatting reports of results.

Example
/**/  use R ::= QQ[x,y];
/**/  I := ideal(987*x+123*y)^4;
/**/  SprintTrunc(I, 20);
ideal(949005240561*x...
/**/  SprintTrunc(gens(I)[1], 20);
949005240561*x^4 +47...

See Also