Pass string formatting as argument to a function