String formatting for javascript