String format function for javascript.