sprintf for javascript