s := string(a<,iwidth><,sfill><,iprec><,sformat>)

Creates a string type.

How the string is created depends on the arguments provided. In general, the first parameter a will be converted to a string.

If width is provided, the string will be at least that many characters in length. If negative, the value is left-aligned. The string will be padded with spaces unless fill is provided, in which case it will be padded with that character.

If the type uses floating point formatting (float or vector), then prec and format will be active as well.
  • prec controls the digits of precision.
  • format controls the floating point formation. This defaults to ‘g’, meaning lower case optimal. The options are ‘G’, ‘f’ or ‘F’ for floating point formation or ‘e’ or ‘E’ for exponential notation.

Vector types will be converted into the format (x,y) or (x,y,z), where each component will use the floating point format specified.

Returns:s - A new string type
Arguments:a - A type to convert to a string iwidth - width of the string created. If negative, the value is left-aligned. The default value is 0, indicating minimum necessary size. sfill - pad character. Defaults to space. iprec - digits of precision for output. Used only for float types. The default value is the current system precision (see the model precision command). sformat - floating point format. Used only for float types.