NumToStr

Converts number to string using an optional format string.

Syntax

NumToStr(number, formatString)

Parameters

Parameter

Type

Description

number

number

Number to be converted to string.

formatString

string

Optional format string (a standard C/C++ format specifier). See, for example, https://www.cplusplus.com/reference/clibrary/cstdio/printf

Return

Returns string representing the specified number.

Examples

The following scripts generate strings:

Event001, Event002, …, Event016

Python

import nex
for i in range(1, 17):
    str = "Event0" + nex.NumToStr(i, "%02.0f")

NexScript

for i=1 to 16
    str = "Event0" + NumToStr(i, "%02.0f")
end