Skip to main content

num2str

num2str (num [, formatStr])

The num2str function returns a string representing the number num.

The optional formatStr parameter was added in Igor Pro 9.00.

If you omit formatStr, the precision of the output string is limited to only five significant digits. This can cause unexpected and confusing results. For this reason, we recommend that that you specify a larger precision with formatStr or use num2istr or sprintf for more control of the format and precision of the number conversion.

Parameters

numThe value to be converted to string representation.
formatStrControls the format of the output string. See printf for details on format strings.
formatStr is optional and requires Igor Pro 9.00 or later.
If you omit formatStr, the format used is "%.5g". For more precision use something like "%.15g".

See Also

printf, sprintf, str2num, num2char, char2num