Add String.format function to main.js.