format()

Example 1:

var pi_str = String.format("4.2",Math.PI)
// would set pi_str to the string "3.14"

Example 2:

var pi_str = String.format("05.2",Math.PI)
// would set pi_str to the string "03.14"